Welcome Guest, Not a member yet? Register   Sign In
Upload Error Response
#1

[eluser]jroot[/eluser]
Hello all

I built a method that handles uploads... Real standard. Set config params and then call the upload library with the config params.

The upload method is called from another method that prepares various inputs for the upload. This upload method may get called several times for many files. Everything works fine with one exception.

In the case that there are multiple file uploads and multiple file upload errors, the errors are concatenated for every upload error. For example, let's say that file 1 is too big and file 2 is the wrong type.

The error for file 1 is 'too big.'.
The error for file 2 is 'too big.wrong type'. The errors are concatenated.

In display_errors() of upload.php, the offender is this line (862):
$str .= $open.$val.$close;

Of course, killing the concat operator (.) after $str solves my problem. But in testing, I found that multiple errors on one file are not returned anyway. It returns the first error encountered on the file... and that's it. In reviewing this I thought that the loop and concat was setup to catch multiple errors on one file. But that isn't so.

My Questions:
1) What is the reason for the concat operator in the foreach loop if
display_errors() will return only a single error per file upload? I just want to know if I'm breaking anything by killing the (.).
2) How is upload.php storing the errors across different calls to do_upload()?

Thanks all!


Messages In This Thread
Upload Error Response - by El Forum - 05-07-2009, 01:35 PM
Upload Error Response - by El Forum - 05-07-2009, 05:02 PM
Upload Error Response - by El Forum - 05-08-2009, 04:38 AM
Upload Error Response - by El Forum - 05-26-2009, 09:10 AM
Upload Error Response - by El Forum - 05-26-2009, 09:24 AM



Theme © iAndrew 2016 - Forum software by © MyBB