jaymc Posted November 21, 2007 Share Posted November 21, 2007 If I am uploading a file via a form, how can I cancel it lets just say its a 100MB file and after 1 minute I decide I want to cancel it Note: Reloading the page is out the question. I just need the actually connection killed, maybe javascript? Quote Link to comment https://forums.phpfreaks.com/topic/78324-solved-cancel-file-upload/ Share on other sites More sharing options...
roopurt18 Posted November 21, 2007 Share Posted November 21, 2007 Click the stop button on your browser? Quote Link to comment https://forums.phpfreaks.com/topic/78324-solved-cancel-file-upload/#findComment-396370 Share on other sites More sharing options...
jaymc Posted November 22, 2007 Author Share Posted November 22, 2007 It has to be in a system, not for personal gain I need it to be a button within the webpage, it submits to an iframe by the way Quote Link to comment https://forums.phpfreaks.com/topic/78324-solved-cancel-file-upload/#findComment-396396 Share on other sites More sharing options...
phpQuestioner Posted November 22, 2007 Share Posted November 22, 2007 you could just actually reload the page with javascript and that should destory the upload process. <script language="javascript"> function stopUpLoad() { document.location.href="thispagesaddresshere.html"; } </script> <a href="javascript:void(0)" onclick="stopUpLoad()">Cancel Upload</a> Quote Link to comment https://forums.phpfreaks.com/topic/78324-solved-cancel-file-upload/#findComment-396398 Share on other sites More sharing options...
jaymc Posted November 23, 2007 Author Share Posted November 23, 2007 No Note: Reloading the page is out the question. I just need the actually connection killed, maybe javascript? Quote Link to comment https://forums.phpfreaks.com/topic/78324-solved-cancel-file-upload/#findComment-397181 Share on other sites More sharing options...
phpQuestioner Posted November 23, 2007 Share Posted November 23, 2007 well here is your window DOM event options - check them out and go from there - that's all I know to tell you; except limit your file size uploads and you will not have this problem. http://developer.mozilla.org/en/docs/DOM:window Quote Link to comment https://forums.phpfreaks.com/topic/78324-solved-cancel-file-upload/#findComment-397205 Share on other sites More sharing options...
fenway Posted November 23, 2007 Share Posted November 23, 2007 define cancel. Quote Link to comment https://forums.phpfreaks.com/topic/78324-solved-cancel-file-upload/#findComment-397653 Share on other sites More sharing options...
jaymc Posted November 23, 2007 Author Share Posted November 23, 2007 In my livechat system you can send files after browsing and clicking submit, it submits to an iframe within the page, therefor, no refresh All working fine, but, in the event someone wants to stop a file upload, I want a button that will cancel it Quote Link to comment https://forums.phpfreaks.com/topic/78324-solved-cancel-file-upload/#findComment-397767 Share on other sites More sharing options...
fenway Posted November 24, 2007 Share Posted November 24, 2007 Well, you can't stop the upload server-side, since it's asynchronous... but why not just reset the src of hte iframe? Quote Link to comment https://forums.phpfreaks.com/topic/78324-solved-cancel-file-upload/#findComment-398196 Share on other sites More sharing options...
jaymc Posted November 24, 2007 Author Share Posted November 24, 2007 Great! Quote Link to comment https://forums.phpfreaks.com/topic/78324-solved-cancel-file-upload/#findComment-398396 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.