mozilla

Compare Revisions

Using files from web applications

Change Revisions

Revision 36078:

Revision 36078 by ing.marco.buratto on

Revision 36079:

Revision 36079 by ing.marco.buratto on

Title:
Using files from web applications
Using files from web applications
Slug:
Using_files_from_web_applications
Using_files_from_web_applications
Tags:
Files, HTML5, MakeBrowserAgnostic, "ajax upload", upload
Files, HTML5, MakeBrowserAgnostic, "ajax upload", upload
Content:

Revision 36078
Revision 36079
n260    <p>n
261      &nbsp;
262    </p>
n264function FileUpload(file) n261function fileUpload(file) 
n266    // marco.buratto@tiscali.itn263    // Please report improvements to: marco.buratto at tiscali.it
264 
n269    var fileData = file.getAsBinary(); // only tested on TEXT datn267    var fileData = file.getAsBinary(); // works on TEXT data.
>a. 
n277    xhr.setRequestHeader("Content-Type","multipart/form-data, boun275    xhr.setRequestHeader("Content-Type","multipart/form-data, bou
>ndary="+boundary); // simulate a file MIME POST request>ndary="+boundary); // simulate a file MIME POST request.
n282        // ;n280        if (xhr.readyState==4)
281            if ((xhr.status &gt;= 200 &amp;&amp; xhr.status &lt;=
 > 200) || xhr.status == 304)
282                {
283                // Handle response.
284                if (xhr.responseText!="") alert(xhr.responseText)
 >;
285                        
286                //;
287                }
t296    <p>t
297      &nbsp;
298    </p>

Back to History