Search

I have a frontend form with a multiple upload field and some other fields.

My problem is that when any other missing/invalid field stops the entry from being created I am not able to recreate the state of the input[type=file]-fields, thus the user would have to reselect his files.

I do get useful looking data in the post-values but using the file-node as value is not working:

  <post-values>
        <veroeffentlicht>yes</veroeffentlicht>
        <autor>170</autor>
        <bilder>
            <item index="1">
                <name>DSCF2525.jpg</name>
                <type>image/jpeg</type>
                <tmp-name>/Applications/MAMP/tmp/php/phpiQ7inE</tmp-name>
                <error>0</error>
                <size>866589</size>
            </item>
            <item index="2">
                <name>H&amp;L Referenzvorlage.png</name>
                <type>image/png</type>
                <tmp-name>/Applications/MAMP/tmp/php/phpVSpIUf</tmp-name>
                <error>0</error>
                <size>295678</size>
            </item>
        </bilder>
    </post-values>

Has anyone tackled this before? I’ve only found posts about editing entries, but not about not-yet-created entries.

As far as I remember, you can't achieve this. This is a browser thingie (security). There has been a longer discussion about it (either here or on GitHub), maybe you can find it.

Thanks Michael, I wasn’t able to find it. If the answer is »no« I’m accepting :(

I guess helper style validation using JS on top of the backend server side validation may reduce the amount of errors prior to sending and losing that data.

Just inform the user as much as possible on what will happen I guess.

Thanks Andrew, good points!

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details