Order Now AdSolution Sign Up | Login » Bits on the Run Sign Up | Login »

Forums

/

Cancel Upload

5 replies [Last post]
Reply

Hi,

This may or not have been discussed before but I looked through the forum posts and couldn't find anything similar.

Is there a way to cancel an upload mid way through?

I'm aware you can use AJAX and JSON-P to update the progress of an upload via the upload/bitsontherun.com/progress directory by supplying the item token. Is there a way to cancel the upload by sending the token to another directory that handles this specific task. Say upload/bitsontherun.com/cancel..?

Regards

Chris

Reply

It's not possible to cancel per say, but refreshing the iFrame that the upload process is happening in will kill it off.

Reply

Oh right, i was under the impression that the iframe was only used for Safari?

Reply

In the upload example we use the iframe so we can run an upload in the background without having to refresh the whole page when upload has completed.

Reply

What about non-safari browsers though?

In the examples I have you have this line:

if($.browser.safari){

Which surely will only apply an iframe if the browser being used is Safari? I cant see any other mention/creation of an iframe for non-safari browsers.

Also the timer that's set up to make the ajax call doesn't seem to be able to be cleared. It's like something else is running that keeps reinstating it even after I've made a clearTimeout/clearInterval call

Reply

I'm not completely certain. In any cast you will have to reload whatever component that is doing the upload or simply reload the whole page to cancel any upload.

Post new comment

  • Allowed HTML tags: <code> <blockquote> <em> <strong> <strike> <ul> <li> <ol>
  • You may post code using <code>...</code> .
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options