简体   繁体   中英

Asynchronous file upload with mootools?

At the moment I am doing file uploading with asp.net:

<asp:FileUpload ID="Upload" runat="server" /> <!-- HTML -->
Upload.PostedFile.SaveAs(physicalPath + "newAvatarTemp.png"); // codebehind

However, I hate it when pages are refreshed for stuff like this. Really, I want to be able to do something with javascript. Looking around on the web, people seem to be using SWF + javascript, but I really want to avoid using flash. I really want something that feels nice, like the gmail file uploader.

How should I go about doing this? Or is it not possible ( I read some posts hinting that file uploading can't be done with ajax). If this is the case, how does gmail do it?

If its not possible to do this with ajax, what are other solutions to make my file upload feel better? I'm fairly new with web technologies, so maybe I am missing something simple.

The trick is to actually use an <iframe> to hide the upload in a new window. The new AJAX functions will allow you to do file upload straight from an AJAX call, but not all browsers support that yet, so you can use the <iframe> technique as a fallback .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM