Created
October 30, 2010 22:46
-
-
Save dz0ny/655830 to your computer and use it in GitHub Desktop.
Example of FormaData for Chrome and Firefox
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
| $.each(dataTransfer.files, function ( i, file ) { | |
| var xhr = new XMLHttpRequest(); | |
| var upload = xhr.upload; | |
| var formdata = new FormData(); | |
| //formdata.append("session",socket.transport.sessionid); | |
| formdata.append('mycustomfieldforfile', file); | |
| xhr.open("POST", "/post/file"); | |
| xhr.send(formdata); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment