Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem with download prompt cancel button

 
saipraneeth nallapareddy
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello everyone,

I am developing an application when user clicks on a button by selecting a file it shows the download prompt with Open/Save/Cancel, Open and Save are working fine. But when clicked on cancel button there is an error being raised on the server with network exception SocketException is being throwed.

How to handle this issue. Can anyone help me in this regard.
 
Michael Angstadt
Ranch Hand
Posts: 277
Eclipse IDE Java PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It sounds like maybe you are not properly closing the connection on the client side when Cancel is clicked.
 
saipraneeth nallapareddy
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
no i have closed all the connections in the finally block.
 
Michael Angstadt
Ranch Hand
Posts: 277
Eclipse IDE Java PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It sounds like you are opening the connection before the user clicks any of the buttons. Maybe you should instead wait for the user to click a button to open the connection. So, if the user clicks Cancel, you can just close the dialog window and the connection will never have been opened, thus preventing that exception from being thrown on the server.
 
Paul Clapham
Sheriff
Pie
Posts: 20764
30
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This cancel button you're describing... is it the one which the browser displays when it decides a response is a file to be downloaded? In that case the error is perfectly normal. It's the same error which occurs when the user interrupts a large page load by clicking on some other link.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic