This week's book giveaway is in the General Computing forum.
We're giving away four copies of Emmy in the Key of Code and have Aimee Lucido on-line!
See this thread for details.
Win a copy of Emmy in the Key of Code this week in the General Computing forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

file downloader for image downloading not upto the limit....

Ranch Hand
Posts: 46
Netbeans IDE MySQL Database Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i create file downloader its downloading perfectely but not an upto the total length

please help me as soon....
Posts: 21817
Eclipse IDE Spring VI Editor Chrome Java Ubuntu Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Available Doesn't Do What You Think It Does.

Also some corrections to your code:
1) check if cat is null, or you will get into problems.

2) you can't use File with an http:// URL. Instead, you should use the following code: ServletContext's getRealPath method will translate the path, relative to your web application, to a real file path. In this case, it would be C:\<Path to Tomcat>\webapps\WebApplication1/image/<filename> on Windows.

3) don't mix response.getWriter() and response.getOutputStream(). Simply remove setting the first content type, and every reference to out.

4) your code is vulnerable to path injection. Suppose the filename is ..\..\..\..\..\..\..\..\..\..\Windows\win.ini - that could allow the user to retrieve C:\Windows\win.ini. With other examples, the user could retrieve important system files. Make sure that you validate the file name first.
What's brown and sticky? ... a stick. Or a tiny ad.
Java file APIs (DOC, XLS, PDF, and many more)
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!