Q: Could you explain how the file upload option works in PHPForms?A: Yes, sure. Please read the explanations below.
Let's say we have a form with two fields:
1. Name
2. file upload
A user submits the form with his file uploaded:
1. My Name
2. cat.jpg
PHPForms does the following:
a. Receives and processes all data from the form.
b. Generates a unique ID of the data from the form, e.g. '6d57e019a0'.
c. Writes data from the form to the database and links each field with its ID:
id => field value
1. 6d57e019a0 => My Name
2. 6d57e019a0 => cat.jpg
d. When it comes to the field with an uploaded file, the script moves the file from a temporary folder (where you server puts them by default) to the folder called '
files' and renames the file.
The scheme for the file name is as follows:
<ID>.<file name>.<file extension>.<special character>
Thus, according to these rules your file has such a name:
6d57e019a0.cat.jpg.~
This scheme is applied to each form's submission.
Even if a hundred users upload files with the same file name, these files will represent a hundred different files linked with these hundred users.
When in the admin panel you view submissions, you see an 'original' file name, i.e. 'cat.jpg'. But if you open the link to the file, it will have a look similar to this:
http://www.domen_name/phpforms/admin.php?code=07&file_id=6d57e019a0i.e. these are different files and PHPForms won't overwrite them in any case.
In case files are attached to email submissions (the feature is available in PHPForms Pro and PHPForms Members), their names remain the same as the original ones.