It is possible, but it doesn’t work in Google Chrome) Look!
... <form method='post' enctype='multipart/form-data'> <input type="file" id="imf" name="imf"/> <input type="button" id="Save"/> </form> ... $("#Save").live("click", function(){ var photo = document.getElementById("imf"); var file = photo.files[0]; $.post('/user/saveNewPhoto', {'imf':file.getAsDataURL(), fname:file.fileName }, function( data ){ alert ( data ); }); });
the download side of the script needs to be decoded base64), and that’s all, but I’m not testing this large file script
user267014
source share