• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

stop downloading the uploaded file on a event

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
We are uploading a file from JSP and there would be a "cancel" button. On click on "cancel" button we need to stop the process of reading the uploaded file i.e we should stop the process of reading the stream and writing the file on the disk. We are using apache commons fileupload for this. Some one kindly helps us on this.

Thanks,
Sai
 
Ranch Hand
Posts: 558
2
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In my personal opinion, I do not think, if it would be possible to stop that is under transmission to the server. Once you click upload, the process begins and clicking "cancel" at a later point, would be a different HTTP request and since HTTP is stateless, it would not know anything what happened earlier or what to stop. So I think it is not possible implicitly. But I would like to see, what experts have to say on this. Though I never tried before, your question made me to think, on those situations where I click "stop" on browser in the middle of some page loading. What kind of requests go to server and how does it handle "Stop".
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think Kumar is right about that. Once the upload has started, there isn't any place to click "Cancel". Of course it's always possible for the user to abort the upload by some other brute force method, like for example closing the browser window or maybe clicking the Back button. However I too don't know what happens at that point. Perhaps you could do some experiments and see for yourself.

Or if you absolutely have to have a Cancel button, perhaps a file-upload applet would be a solution.
 
reply
    Bookmark Topic Watch Topic
  • New Topic