Last active
December 10, 2015 00:28
-
-
Save sarumont/4351076 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <iframe id="upload_target" style="display:none;width:0;height:0"></iframe> | |
| <form action="<upload handler>" target="upload_target" enctype="multipart/form-data" method="post"> | |
| <input type="file" name="file" /> | |
| </form> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <form action="<upload handler>" enctype="multipart/form-data" method="post"> | |
| <input type="file" name="file" /> | |
| </form> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function sendForm(form) { | |
| var formData = new FormData(form); | |
| var req = new XMLHttpRequest(); | |
| req.open("POST", "<upload handler>"); | |
| req.send(formData); | |
| return req; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment