• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Servlet Download Problem

 
Thangavelu Vishwanathan
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am using a servlet for downloading my octet-stream file from server. Its working fine when the size of the file is above 0 bytes. If the file size is 0 bytes the file is not downloaded and I am getting http 502 error in server.

Anybody have solution for this issue?

Here is my code:
 
Devaka Cooray
Marshal
Pie
Posts: 4880
402
Chrome Eclipse IDE Google App Engine IntelliJ IDE jQuery Postgres Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just a side question: why do you need to download a file with 0 bytes?
 
Thangavelu Vishwanathan
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have kept a download option but when the file size is 0 bytes also it must show me a empty file.
 
Wouter Oet
Saloon Keeper
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the exception you're getting?
 
Thangavelu Vishwanathan
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I didnt get any exception, but when i click the download link, the browser status bar is keep on loading. In addition I am getting the Http 502 Bat Gateway error.
 
Satya Maheshwari
Ranch Hand
Posts: 368
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I suggest you put a breakpoint in your servlet code and see what 's going wrong.
 
Thangavelu Vishwanathan
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,

Thank You all,

Its a problem of application server and not in the coding part.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic