Forums

File Upload seems to be unreliable

tshirley 26 Jan, 2019
Hi,

I have a form with basic file upload fields. Automatic load, Automatic upload to the server. In fact, apart from all the other fields in the form, it looks the same as the upload demo form.

It works in test mode and when I run it myself in production, but for some of my users the form gives no error message but fails to upload the file to the server, and it isn't attached to the email (not surprising if it isn't in the server). It is happening about 50% of the time.

So I am having trouble tracking this down. I have several other forms which do uploads OK so I am very puzzled by this one.

The other problem is that this form does not appear to be testing or reporting the Max/Min file size checks. I tried this with the demo form and again there was no error from the Max/Min file size even when the size of the file was well out of limits.

Cheers

Tim
healyhatman 26 Jan, 2019
Have you got the max/min set in the file upload action too? And have you got it to do something like stop or display an error if the upload fails?

Either way, try putting the contents of this text file in a PHP Code block, preferably in the upload failed box.[file=11536]file_errors.txt[/file]


And then use {var:php_block_name} or {var.pr:php_block_name} in a message or custom code action to display the errors. This should help track down what's going on.
tshirley 26 Jan, 2019
Thanks, I tried your suggestion.

Unfortunately, it doesn't fail. When this problem happens, it just doesn't upload any file. Seems to ignore the upload block completely. Hard to test thoroughly because this is happening in production - I can't reproduce it in test or by running in prod as if I were a user. I know it is happening because I can see the files not turning up in the server, when I know the user has uploaded them (I ask them now).

I have been able to test the Max/min error using the standard demo form (not one I wrote myself). If I set Min to 30000 and load a file of 20KB, it just uploads. No error.

The Max limit works however and gives an error when the file is bigger.

Dunno.

Cheers

Tim
healyhatman 26 Jan, 2019
Are the files in a repeater or are they multiselect at all?
tshirley 26 Jan, 2019
No, these are simple forms with individual separate upload fields. I have tried to simplify as much as possible to attempt to track it down.
This topic is locked and no more replies can be posted.