Hello everybody,
I've a form where the user is able to decide how much file(s) he wants to upload; he should also be able to send a form without any file: the file field isnt required..
I followed the tutorial found here to archive this: http://www.chronoengine.com/faqs/70-cfv5/5245-how-can-i-use-the-multiplier-in-cfv5.html
I'm now trying to validate the files, the user uploads. I dont want the user to upload files bigger than 5 mb and I only want him to upload files with the extensions jpg-png-gif-pdf-zip-rar.
Here is what I did so far:
[attachment=0]designer_multiplier_overview.png[/attachment]
[attachment=1]setup_overview.png[/attachment]
[attachment=2]setup_files_upload_1.png[/attachment]
[attachment=3]setup_files_upload_2.png[/attachment]
If I now test the form, I get the following results:
1. If I upload a file that is not allowed, I get the correct error message for wrong file type (Perfect!)
2. If I upload one file that is allowed and one that is not allowed, I get the correct error message for wrong file type (Good!)
3. If I upload two files that are allowed, an E-Mail with both files attached is sent (Perfect!)
4. If I upload a file that is not allowed and too big, an error message is show: This file is too big! (Good, better: This file is too big and the file type is not allowed)
5. If I upload a file that is allowed, but bigger than 5 MB an empty E-Mail is sent without the attachment and no error message (file is too big!) is shown (Problem!)
6. The same happens, when I upload one file that is allowed and one file that is too big
I'm afraid the answer to this is very complex because of the multiplier option. Or is is simple and I'm just missing something?🙂
As always: Thank you very much in advance.
Best Regards,
Marc
I've a form where the user is able to decide how much file(s) he wants to upload; he should also be able to send a form without any file: the file field isnt required..
I followed the tutorial found here to archive this: http://www.chronoengine.com/faqs/70-cfv5/5245-how-can-i-use-the-multiplier-in-cfv5.html
I'm now trying to validate the files, the user uploads. I dont want the user to upload files bigger than 5 mb and I only want him to upload files with the extensions jpg-png-gif-pdf-zip-rar.
Here is what I did so far:
[attachment=0]designer_multiplier_overview.png[/attachment]
[attachment=1]setup_overview.png[/attachment]
[attachment=2]setup_files_upload_1.png[/attachment]
[attachment=3]setup_files_upload_2.png[/attachment]
If I now test the form, I get the following results:
1. If I upload a file that is not allowed, I get the correct error message for wrong file type (Perfect!)
2. If I upload one file that is allowed and one that is not allowed, I get the correct error message for wrong file type (Good!)
3. If I upload two files that are allowed, an E-Mail with both files attached is sent (Perfect!)
4. If I upload a file that is not allowed and too big, an error message is show: This file is too big! (Good, better: This file is too big and the file type is not allowed)
5. If I upload a file that is allowed, but bigger than 5 MB an empty E-Mail is sent without the attachment and no error message (file is too big!) is shown (Problem!)
6. The same happens, when I upload one file that is allowed and one file that is too big
I'm afraid the answer to this is very complex because of the multiplier option. Or is is simple and I'm just missing something?🙂
As always: Thank you very much in advance.
Best Regards,
Marc