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

[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...


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