ajax - YES or NO: Can a server send an HTTP response, while still uploading the file from the correlative HTTP request? -
if website user submits html form with: (1) post method; (2) multipart/form-data enctype; and, (3) large attached file, can server upload posted file, , send server generated http response before file upload completed, without using ajax?
that's pretty dense. so, wrote example illustrate mean. let's there image upload form caption field.
<form action="upload-with-caption/" method="post" enctype="multipart/form-data"> <input type="hidden" id="hiddeninfo" name="hiddeninfo" /> file: <input type="file" name="imgfile" id="imgfile" /><br /> caption: <input type="text" name="caption" id="caption" /> <input type="submit" /> </form>
i want store caption in database table the definition:
[files_table]
- file_id [uniqueidentifier]
- file_caption [varchar(500)]
- file_status [int]
then want upload file /root/{unique-id}/filename.ext
.
file_status mapped c# enum following definition:
enum fileuploadstatus{ error = 0, uploading = 1, uploaded = 2 }
when form submits, if file large process in 1 second, want send webpage response says uploading.
can single synchronous http post?
note: want check status updates later using ajax, not question asking. asking if file can continue upload after response sent.
http synchronous protocol.
cannot send response until receive entire request.
Comments
Post a Comment