Forums

Uploaded Files Names

salimyasin 25 Sep, 2010
Hello Everybody, I've searched a lot for my questions and I got some solutions but not what I really need, any way hope that this will be new question.

I have a form which has 8 file upload boxes, every thing goes very smooth for upload and email but how can I add some text to the files names that let me know from which file upload box that file has been uploaded. for example file_1, file_2, file_3 is the file upload boxes name tag, I need the uploaded files to be renamed to file_1.pdf, file_2.xls, file_3.jpg rather than using the default naming.

Thanks in advance.
Salim.
GreyHead 26 Sep, 2010
Hi salimyasin,

This is possible but not simple. The file uploads tab is quite flexible but applies the same code to all file uploads.

The safest way to do it is probably to rename the files after they are uploaded using PHP in one of the OnSubmit boxes.

Bob

PS I've written a How-to document on "Uploaded file and folder names" available for a small fee here. This does not specifically answer your question but most of the code you need is in the document.
salimyasin 26 Sep, 2010
Bob,

Thank you for the replay, you are totally right about the file uploads tab and I have no problem with renaming the files on the server after they have uploaded to the server, the problem is that I need the attachments to be renamed before they sent to the user.

BTW: I spent 3 months browsing this forum for my questions and I really didn't need to look in any other place for an answer, thank you for the great support.
Salim.
GreyHead 26 Sep, 2010
Hi Salim,

Hmm . . . I think it's probably possible to rename the files *and* edit the entries in the ChronoForms attachment array to match but I've never had to do it. The code would need to be in the OnSubmit Before box so that it was executed before the email is sent.

Thanks for the kind thoughts - much appreciated.

Bob
salimyasin 26 Sep, 2010
Thank you for the hint, I'll give it a try tonight and I'll post my code to share here if I successfully passed this issue.

Regards,
Salim.
This topic is locked and no more replies can be posted.