Find centralized, trusted content and collaborate around the technologies you use most. Connect and share knowledge within a single location that is structured and easy to search. I am using the dojo. I want to provide a way that the user can cancel the send once it is in progress, in case it is taking too long or the user realizes she sent the wrong file. I can't figure a way to do this.
I could use a timeout to terminate the send if it is taking a long time that is, the server does not respond quickly , but that is not what I want. I want to terminate any time the user makes a gesture such as clicking a "Cancel" button. For security reasons JavaScript cannot even access the file you are sending up. All file uploads are done using a form and handled by the browser directly.
To my best knowledge there is no direct interface to monitor the progress of upload, nor the way to affect it e. Navigating away may help, but it is still up to the browser to interrupt the transfer or not — there is no specification for that. To sum it up: not possible to do it reliable in JavaScript in the portable fashion. That means Dojo does not provide this functionality. Hi i realize this is a rather late reply so i hope you or someone who stumbled here through google will have some use for this.
It is possible to cancel the file upload in the iFrame, in Firefox you can call the method window. IE however doesn't have this method but comes with the execCommand "Stop" however since manually pressing stop doesn't even work the scripted stop wont either. I have integrated the code u provided but on IE8 it is returning a download pop up which contains json response which currenly we are printing on page.
What is the Controller logic? Can I use like this? Hey Thanks, Nice article. I was searching from many hours to find the solution provided here. How does the data from the server side retrieves to above mention page after the form is submitted.
How to show these data in readable form. Your email address will not be published. Save my name, email, and website in this browser for the next time I comment. File uploading using AJAX is not possible. You have to resort to regular old form submit. File uploading occurs through an iframe in this case. You have to use a iframe to upload the files. How file uploading is done in Gmail?
Use following JavaScript function, if you want to achieve same functionality. Get our Articles via Email. Enter your email address. Usman says:. Marakas says:. GOPalmer says:. Nags says:. Fantab says:. Franc says:. Anji says:. Abhishek Sikka says:. Foo Bar says:. Archan Ghosal says:. J-Tech Solutions says:. Deepak says:. Viral Patel says:. Jason Russo says:. Lakshmeepathi G says:.
Improve this answer. Quentin Quentin k gold badges silver badges bronze badges. Darren Willows Darren Willows 1, 12 12 silver badges 20 20 bronze badges. Sign up or log in Sign up using Google.
Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Podcast Helping communities build their own LTE networks. Podcast Making Agile work for data science. Featured on Meta. New post summary designs on greatest hits now, everywhere else eventually.
Linked See more linked questions. Related Hot Network Questions.
0コメント