Problem in forms with file upload

Hello,
a problem has arisen with forms with HTML file uploads. A form contains a mandatory field and a form upload field. If you select a file and leave out information in the mandatory field, an error message appears, but the previously selected file is lost.

With an individually programmed form (without form block) there is a PHP error message with a reference to a non-existent file in a temp directory.

Any idea how to fix this?

Information about the web environment

Concrete Version

Core Version - 9.2.4
Version Installed - 9.2.4
Database Version - 20231207100748

Hostname

infongd-eu3748

Environment

production

Database Information

Version: 10.6.15-MariaDB-1:10.6.15+maria~deb11-log
SQL Mode:

Concrete Packages

Glossary List (1.1.1), Open Graph Tags Lite (2.1.6), Pixel Theme (9.1.0)

Concrete Overrides

blocks/fz_languageselect/controller.php, blocks/fz_languageselect/icon.png, blocks/fz_languageselect/view.php, blocks/fz_languageselect, blocks/content/templates/_ae_kasten_schatten.php, blocks/content/templates, blocks/content, blocks/express_entry_detail/templates/niederlassungen_detail.php, blocks/express_entry_detail/templates/fahrerinterviews_detail.php, blocks/express_entry_detail/templates/person_detail.php, blocks/express_entry_detail/templates, blocks/express_entry_detail, blocks/express_entry_list/templates/slick/ajax-loader.gif, blocks/express_entry_list/templates/slick/config.rb, blocks/express_entry_list/templates/slick/fonts/slick.eot, blocks/express_entry_list/templates/slick/fonts/slick.svg, blocks/express_entry_list/templates/slick/fonts/slick.ttf, blocks/express_entry_list/templates/slick/fonts/slick.woff, blocks/express_entry_list/templates/slick/fonts, blocks/express_entry_list/templates/slick/slick-theme.css, blocks/express_entry_list/templates/slick/slick-theme.less, blocks/express_entry_list/templates/slick/slick-theme.scss, blocks/express_entry_list/templates/slick/slick.css, blocks/express_entry_list/templates/slick/slick.js, blocks/express_entry_list/templates/slick/slick.less, blocks/express_entry_list/templates/slick/slick.min.js, blocks/express_entry_list/templates/slick/slick.scss, blocks/express_entry_list/templates/slick, blocks/express_entry_list/templates/fahrerinterviews_carousel.php, blocks/express_entry_list/templates/fahrerinterviews_uebersicht.php, blocks/express_entry_list/templates/images/pin_web.png, blocks/express_entry_list/templates/images/view.php, blocks/express_entry_list/templates/images, blocks/express_entry_list/templates/leaflet/images/_my-marker.png, blocks/express_entry_list/templates/leaflet/images/layers-2x.png, blocks/express_entry_list/templates/leaflet/images/layers.png, blocks/express_entry_list/templates/leaflet/images/marker-icon-2x.png, blocks/express_entry_list/templates/leaflet/images/marker-icon.png, blocks/express_entry_list/templates/leaflet/images/marker-shadow.png, blocks/express_entry_list/templates/leaflet/images/person-placeholder.jpg, blocks/express_entry_list/templates/leaflet/images, blocks/express_entry_list/templates/leaflet/leaflet-src.esm.js, blocks/express_entry_list/templates/leaflet/leaflet-src.esm.js.map, blocks/express_entry_list/templates/leaflet/leaflet-src.js, blocks/express_entry_list/templates/leaflet/leaflet-src.js.map, blocks/express_entry_list/templates/leaflet/leaflet.css, blocks/express_entry_list/templates/leaflet/leaflet.js, blocks/express_entry_list/templates/leaflet/leaflet.js.map, blocks/express_entry_list/templates/leaflet, blocks/express_entry_list/templates/lib/ExpressDataContainer_FahrerInterviews.php, blocks/express_entry_list/templates/lib/ExpressDataContainer_Linkliste.php, blocks/express_entry_list/templates/lib/ExpressDataContainer_Niederlassungen.php, blocks/express_entry_list/templates/lib/ExpressDataContainer_Person.php, blocks/express_entry_list/templates/lib/ExpressDataContainer_ReferenzenKlein.php, blocks/express_entry_list/templates/lib/ExpressDataContainer_Referenzen.php, blocks/express_entry_list/templates/lib, blocks/express_entry_list/templates/linkliste_uebersicht.php, blocks/express_entry_list/templates/Modaal-master/dist/css/modaal.css, blocks/express_entry_list/templates/Modaal-master/dist/css/modaal.min.css, blocks/express_entry_list/templates/Modaal-master/dist/css/modaal.scss, blocks/express_entry_list/templates/Modaal-master/dist/css, blocks/express_entry_list/templates/Modaal-master/dist/js/modaal.js, blocks/express_entry_list/templates/Modaal-master/dist/js/modaal.min.js, blocks/express_entry_list/templates/Modaal-master/dist/js, blocks/express_entry_list/templates/Modaal-master/dist, blocks/express_entry_list/templates/Modaal-master/LICENSE.txt, blocks/express_entry_list/templates/Modaal-master/README.md, blocks/express_entry_list/templates/Modaal-master, blocks/express_entry_list/templates/niederlassungen_auswahl_stellenanzeigen.php, blocks/express_entry_list/templates/niederlassungen_karte.php, blocks/express_entry_list/templates/referenzen_details_uebersicht.php, blocks/express_entry_list/templates/referenzen_klein_uebersicht.php, blocks/express_entry_list/templates/referenzen_slider.php, blocks/express_entry_list/templates, blocks/express_entry_list, blocks/faq/templates/pixel_1_FZ_modified.php, blocks/faq/templates, blocks/faq, blocks/image_slider/templates/pixel_owl_modified.php, blocks/image_slider/templates, blocks/image_slider, blocks/page_list/templates/pixel_portfolio_carousel_FZ_modified.php, blocks/page_list/templates, blocks/page_list, blocks/_BACKUP/fz_contact/controller.php, blocks/_BACKUP/fz_contact/icon.png, blocks/_BACKUP/fz_contact/view.php, blocks/_BACKUP/fz_contact/lib/DataContainer_ContactCustomer.php, blocks/_BACKUP/fz_contact/lib, blocks/_BACKUP/fz_contact, blocks/_BACKUP/fz_languageselect/controller.php, blocks/_BACKUP/fz_languageselect/icon.png, blocks/_BACKUP/fz_languageselect/view.php, blocks/_BACKUP/fz_languageselect, blocks/_BACKUP/fz_zvoove_recruit/controller.php, blocks/_BACKUP/fz_zvoove_recruit/icon.png, blocks/_BACKUP/fz_zvoove_recruit/view.php, blocks/_BACKUP/fz_zvoove_recruit/lib/ConnectZvoove.php, blocks/_BACKUP/fz_zvoove_recruit/lib/DataContainer_BewerbungNeuanlage.php, blocks/_BACKUP/fz_zvoove_recruit/lib/DataContainer_ListenStelle.php, blocks/_BACKUP/fz_zvoove_recruit/lib/DataContainer_Mandant.php, blocks/_BACKUP/fz_zvoove_recruit/lib/DataContainer_Stelle.php, blocks/_BACKUP/fz_zvoove_recruit/lib/DataContainer_Trait.php, blocks/_BACKUP/fz_zvoove_recruit/lib/DataContainer_Lookup.php, blocks/_BACKUP/fz_zvoove_recruit/lib, blocks/_BACKUP/fz_zvoove_recruit/_devtemp/homer.jpg, blocks/_BACKUP/fz_zvoove_recruit/_devtemp/homer_2.jpg, blocks/_BACKUP/fz_zvoove_recruit/_devtemp, blocks/_BACKUP/fz_zvoove_recruit, blocks/_BACKUP/express_entry_detail/templates/fahrerinterviews_detail.php, blocks/_BACKUP/express_entry_detail/templates/niederlassungen_detail.php, blocks/_BACKUP/express_entry_detail/templates/person_detail.php, blocks/_BACKUP/express_entry_detail/templates, blocks/_BACKUP/express_entry_detail, blocks/_BACKUP/express_entry_list/templates/fahrerinterviews_carousel.php, blocks/_BACKUP/express_entry_list/templates/niederlassungen_karte.php, blocks/_BACKUP/express_entry_list/templates/fahrerinterviews_uebersicht.php, blocks/_BACKUP/express_entry_list/templates/linkliste_uebersicht.php, blocks/_BACKUP/express_entry_list/templates/referenzen_details_uebersicht.php, blocks/_BACKUP/express_entry_list/templates/referenzen_klein_uebersicht.php, blocks/_BACKUP/express_entry_list/templates/niederlassungen_auswahl_stellenanzeigen.php, blocks/_BACKUP/express_entry_list/templates/referenzen_slider.php, blocks/_BACKUP/express_entry_list/templates/images/pin_web.png, blocks/_BACKUP/express_entry_list/templates/images/view.php, blocks/_BACKUP/express_entry_list/templates/images, blocks/_BACKUP/express_entry_list/templates/leaflet/leaflet-src.esm.js.map, blocks/_BACKUP/express_entry_list/templates/leaflet/leaflet-src.esm.js, blocks/_BACKUP/express_entry_list/templates/leaflet/leaflet.css, blocks/_BACKUP/express_entry_list/templates/leaflet/leaflet-src.js, blocks/_BACKUP/express_entry_list/templates/leaflet/leaflet-src.js.map, blocks/_BACKUP/express_entry_list/templates/leaflet/leaflet.js.map, blocks/_BACKUP/express_entry_list/templates/leaflet/leaflet.js, blocks/_BACKUP/express_entry_list/templates/leaflet/images/layers-2x.png, blocks/_BACKUP/express_entry_list/templates/leaflet/images/layers.png, blocks/_BACKUP/express_entry_list/templates/leaflet/images/marker-icon-2x.png, blocks/_BACKUP/express_entry_list/templates/leaflet/images/marker-icon.png, blocks/_BACKUP/express_entry_list/templates/leaflet/images/marker-shadow.png, blocks/_BACKUP/express_entry_list/templates/leaflet/images/person-placeholder.jpg, blocks/_BACKUP/express_entry_list/templates/leaflet/images/_my-marker.png, blocks/_BACKUP/express_entry_list/templates/leaflet/images, blocks/_BACKUP/express_entry_list/templates/leaflet, blocks/_BACKUP/express_entry_list/templates/lib/ExpressDataContainer_FahrerInterviews.php, blocks/_BACKUP/express_entry_list/templates/lib/ExpressDataContainer_Linkliste.php, blocks/_BACKUP/express_entry_list/templates/lib/ExpressDataContainer_Niederlassungen.php, blocks/_BACKUP/express_entry_list/templates/lib/ExpressDataContainer_Person.php, blocks/_BACKUP/express_entry_list/templates/lib/ExpressDataContainer_Referenzen.php, blocks/_BACKUP/express_entry_list/templates/lib/ExpressDataContainer_ReferenzenKlein.php, blocks/_BACKUP/express_entry_list/templates/lib, blocks/_BACKUP/express_entry_list/templates/Modaal-master/LICENSE.txt, blocks/_BACKUP/express_entry_list/templates/Modaal-master/README.md, blocks/_BACKUP/express_entry_list/templates/Modaal-master/dist/css/modaal.css, blocks/_BACKUP/express_entry_list/templates/Modaal-master/dist/css/modaal.min.css, blocks/_BACKUP/express_entry_list/templates/Modaal-master/dist/css/modaal.scss, blocks/_BACKUP/express_entry_list/templates/Modaal-master/dist/css, blocks/_BACKUP/express_entry_list/templates/Modaal-master/dist/js/modaal.js, blocks/_BACKUP/express_entry_list/templates/Modaal-master/dist/js/modaal.min.js, blocks/_BACKUP/express_entry_list/templates/Modaal-master/dist/js, blocks/_BACKUP/express_entry_list/templates/Modaal-master/dist, blocks/_BACKUP/express_entry_list/templates/Modaal-master, blocks/_BACKUP/express_entry_list/templates/slick/config.rb, blocks/_BACKUP/express_entry_list/templates/slick/ajax-loader.gif, blocks/_BACKUP/express_entry_list/templates/slick/slick-theme.css, blocks/_BACKUP/express_entry_list/templates/slick/slick-theme.scss, blocks/_BACKUP/express_entry_list/templates/slick/slick.css, blocks/_BACKUP/express_entry_list/templates/slick/slick-theme.less, blocks/_BACKUP/express_entry_list/templates/slick/slick.js, blocks/_BACKUP/express_entry_list/templates/slick/slick.less, blocks/_BACKUP/express_entry_list/templates/slick/slick.min.js, blocks/_BACKUP/express_entry_list/templates/slick/slick.scss, blocks/_BACKUP/express_entry_list/templates/slick/fonts/slick.svg, blocks/_BACKUP/express_entry_list/templates/slick/fonts/slick.eot, blocks/_BACKUP/express_entry_list/templates/slick/fonts/slick.ttf, blocks/_BACKUP/express_entry_list/templates/slick/fonts/slick.woff, blocks/_BACKUP/express_entry_list/templates/slick/fonts, blocks/_BACKUP/express_entry_list/templates/slick, blocks/_BACKUP/express_entry_list/templates, blocks/_BACKUP/express_entry_list, blocks/_BACKUP, blocks/fz_contact/controller.php, blocks/fz_contact/icon.png, blocks/fz_contact/lib/DataContainer_ContactCustomer.php, blocks/fz_contact/lib, blocks/fz_contact/view.php, blocks/fz_contact, blocks/pixel_cta/templates/pixel_btn_border_fill_effect.php, blocks/pixel_cta/templates, blocks/pixel_cta, blocks/feature/templates/pixel_centered_icon.php, blocks/feature/templates, blocks/feature, blocks/fz__lib/Helper.php, blocks/fz__lib, blocks/fz_zvoove_recruit/view.php, blocks/fz_zvoove_recruit/_devtemp/homer_2.jpg, blocks/fz_zvoove_recruit/_devtemp/homer.jpg, blocks/fz_zvoove_recruit/_devtemp, blocks/fz_zvoove_recruit/BewerbungLog/Bewerbungen.csv, blocks/fz_zvoove_recruit/BewerbungLog, blocks/fz_zvoove_recruit/controller.php, blocks/fz_zvoove_recruit/icon.png, blocks/fz_zvoove_recruit/lib/ConnectZvoove.php, blocks/fz_zvoove_recruit/lib/DataContainer_BewerbungNeuanlage.php, blocks/fz_zvoove_recruit/lib/DataContainer_ListenStelle.php, blocks/fz_zvoove_recruit/lib/DataContainer_Lookup.php, blocks/fz_zvoove_recruit/lib/DataContainer_Mandant.php, blocks/fz_zvoove_recruit/lib/DataContainer_Stelle.php, blocks/fz_zvoove_recruit/lib/DataContainer_Trait.php, blocks/fz_zvoove_recruit/lib, blocks/fz_zvoove_recruit/templates/auswahl_stellenanzeigen.php, blocks/fz_zvoove_recruit/templates/initiativ_bewerbung.php, blocks/fz_zvoove_recruit/templates, blocks/fz_zvoove_recruit/view_parts/formFieldsAnlagen.php, blocks/fz_zvoove_recruit/view_parts/devtest.php, blocks/fz_zvoove_recruit/view_parts/formFieldsDatenschutz.php, blocks/fz_zvoove_recruit/view_parts/formFieldsHoneypot.php, blocks/fz_zvoove_recruit/view_parts/formFieldsPerson.php, blocks/fz_zvoove_recruit/view_parts/formFieldsWeitereFragen.php, blocks/fz_zvoove_recruit/view_parts/stellenanzeigenSelect.php, blocks/fz_zvoove_recruit/view_parts, blocks/fz_zvoove_recruit

Concrete Cache Settings

Block Cache - On
Overrides Cache - On
Full Page Caching - On - In all cases.
Full Page Cache Lifetime - Only when manually removed or the cache is cleared.

Server Software

Apache

Server API

cgi-fcgi

PHP Version

8.1.27

PHP Extensions

bcmath, bz2, calendar, cgi-fcgi, Core, ctype, curl, date, dba, dom, exif, fileinfo, filter, ftp, gd, gettext, gmp, hash, iconv, imap, intl, json, libxml, mbstring, mysqli, mysqlnd, openssl, pcre, PDO, pdo_mysql, pdo_sqlite, Phar, posix, Reflection, session, shmop, SimpleXML, soap, sodium, SPL, sqlite3, standard, tidy, tokenizer, xml, xmlreader, xmlwriter, xsl, zip, zlib

PHP Settings

max_execution_time - 30
max_file_uploads - 20
max_input_nesting_level - 64
max_input_time - -1
max_input_vars - 1000
max_multipart_body_parts - -1
memory_limit - 512M
post_max_size - 8M
upload_max_filesize - 2M
zend.exception_string_param_max_len - 15
mbstring.regex_retry_limit - 1000000
mbstring.regex_stack_limit - 100000
mysqli.max_links - Unlimited
mysqli.max_persistent - Unlimited
pcre.backtrack_limit - 1000000
pcre.recursion_limit - 100000
session.cache_limiter - no value
session.gc_maxlifetime - 7200
soap.wsdl_cache_limit - 5
unserialize_max_depth - 4096

Seems like it might be related to the permissions of your tmp directory or something along those lines - you can check on a plain install here and if you can’t recreate it there that will help narrow it down to either custom code or the hosting environment.

We found the following hint in another forum:


// if we use move_uploaded_file() Concrete5 Version 9 will crash… seems like this is made now somewhere internally.
//move_uploaded_file($anlage->getPathname(), $target);
// therefore we simply copy the file to where we need it.
copy($anlage->getPathname(), $target);

We had also used “move_uploaded_file” to temporarily save the transferred file.

Obviously, Concrete5 is probably bothered by this in the newer version. Perhaps there is now an internal mechanism that takes care of the “caching of form files”. And it probably couldn’t find the transferred file because we had already moved it before.

Now we make a simple copy of the file and everything is fine.

1 Like