This is a discussion on RE: [PHP] Re: uploading files... necessary Ajax? within the PHP General forums, part of the PHP Programming Forums category; [snip] So that I can get my head around this, are all of you saying there is no Ajax equivalent ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
[snip]
So that I can get my head around this, are all of you saying there is no Ajax equivalent of: <form action="index.php" enctype="multipart/form-data" method="post"> <input type="hidden" name="MAX_FILE_SIZE" value="2048000" > <input name="userfile" type="file"> <input type="hidden" name="stage" value="1"> <input type="submit" value="submit"> We can't in some way use the ajax post method to send the file in the background without a refresh (other than using iframe) is that correct? Or am I completely missing something here? [/snip] That is correct. Without an IFRAME you cannot upload a file without a refresh. |
|
|||
|
Jay Blanchard wrote:
> [snip] > So that I can get my head around this, are all of you saying there is > no Ajax equivalent of: > > <form action="index.php" enctype="multipart/form-data" method="post"> > <input type="hidden" name="MAX_FILE_SIZE" value="2048000" > > <input name="userfile" type="file"> > <input type="hidden" name="stage" value="1"> > <input type="submit" value="submit"> > > We can't in some way use the ajax post method to send the file in the > background without a refresh (other than using iframe) is that > correct? Or am I completely missing something here? > [/snip] > > That is correct. Without an IFRAME you cannot upload a file without a > refresh. huh? if I post a file to a script that returns a 204 status and nothing else then the page should not change in the browser. of course as Colin pointed out this leaves much to be desired in terms of usability so for practical purposes you'll want to use an Iframe hack or upload widget built with java or flash. > |
|
|||
|
[snip]
huh? if I post a file to a script that returns a 204 status and nothing else then the page should not change in the browser. [/snip] True, the missing piece is that the post cannot move the file up to the server. |
|
|||
|
Jay Blanchard wrote:
> [snip] > huh? if I post a file to a script that returns a 204 status and nothing > else then the page should not change in the browser. > [/snip] > > True, the missing piece is that the post cannot move the file up to the > server. I was referring to a standard POST not using AJAX. > |