Search

I have a section with an file upload field and a front-end page to edit an entry of this section.

I’m populating the fields with the stored informations, so the user edit only the fields he wants and the others keep their values.

It works fine but I don’t know how to handle the file upload field. If I leave it blank it updates with no files. How do I keep the stored info of this field?

This is a common problem. You should only write the file upload input to the form IF the user wants to upload a file. Otherwise a blank file will be sent to the event and your previous file will be lost. Take a look at the HTML of a file upload field in the backend and you should see that if you’re editing an entry and the field is populated, you can send the existing file path as the value and it will retain the file.

Thanks Nick, I acctualy redirected to a page with a form just to change the file. But in the future I’ll take your advice and check out the HTML of the backend.

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