[eluser]jroot[/eluser]
[quote author="TheFuzzy0ne" date="1241755370"]As far as I can see, do_upload() should only really be called once in any given HTTP request.[/quote]
Fuzz,
Thanks for the reply and the welcome! I appreciate it.
That's what I guessed as I reviewed the library. The messages are stored and made available via display_errors(). Thanks for the tag concat info... I didn't catch that because it seemed handled in one iteration.
Code:
function display_errors($open = '<p>', $close = '</p>')
{
$str = '';
foreach ($this->error_msg as $val)
{
$str .= $open.$val.$close;
}
return $str;
}
Notice that open calls the open tag, and close calls the closing tag in a single iteration. By just looking at the library I can't identify the instance where the error would be an array greater than 1 item. If all that is thrown is a single error in the error array, the iteration is unneccesary.
You are probably correct that 1 upload request per http request is how the library was designed. That's probably why people have been posting issues with multiple uploads - and requesting a true multi-upload library. However, it does seem to work with two modifications. First, I strip the tags in the response anyway because my view handles the display. Second, by pulling the concat operator, the errors are not concatenated.
If I could identify the instance where the error returned would be multiple errors, I could understand the potential risk of removing the concat operator...