Re: Re: uploading files... necessary Ajax?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Colin Guthrie wrote:
> T.Lensselink wrote:
>> On Wed, 21 Nov 2007 08:38:18 -0600, "Jay Blanchard" <jblanchard@xxxxxxxxxx>
>> wrote:
>>> [snip]
>>> Seems to me Pere want's to do an upload without reloading the whole
>>> page.
>>> [/snip]
>>>
>>> The problem is that you cannot upload files using Ajax alone. But you
>>> can do it without a reload, requires an invisible IFRAME and a little
>>> technique. Search Google for several different articles on this.
>> Indeed uploading with only Ajax is not possible.
>> The already named iframe technique was the only thing i could think of.
>> I was just curious if Jochem knew some other way of tackling this problem.
> 
> I've not tried but I thought the point of returning a status code as
> Jochem mentioned would cause the browser to not need to download the
> content again?
> 
> e.g. it gets a status code of e.g. 304 Not Changed and no data will the
> browser need to reload the page from it's cache or will it just keep the
> current page as it is. I would have thought this was a client-side
> implementation issue rather than anything else.

correct. you send a request to the server, which includes the file being
uploaded - at the stage of sending a request there is nothing to reload, all
the way through the upload the page just sits there. when the server completes
handling the request it will send a status header and optionally some content.

inb the case of return a 304 to the browser, your telling the browser to use
whatever it's already displaying - actually I feel the 204 status is more appropriate.
in both cases no content is returned, and no page is refreshed/reloaded/whatever :-)

> 
> Of course with these codes you can't inform someone that something has
> gone wrong, but I guess you only issue the codes on success. That said
> it will be a little odd exerpience for the user without some form of
> positive feedback. Just a click a small wait with mouse cursor whirring
> then it stops and that's it.... bit odd.

I agree.

> 
> 
> Col
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux