aspose file tools
The moose likes Java in General and the fly likes file downloader for image downloading not upto the limit.... Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "file downloader for image downloading not upto the limit...." Watch "file downloader for image downloading not upto the limit...." New topic
Author

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

prasad guna
Ranch Hand

Joined: Feb 12, 2009
Posts: 38

i create file downloader its downloading perfectely but not an upto the total length


please help me as soon....


Prasath.G
SCJP
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19216

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.


SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: file downloader for image downloading not upto the limit....
 
Similar Threads
Uploading Image from Java Desktop App to Server
file downloading concept
Getting java.io.FileNotFoundException:(The system cannot find the file specified) error
Problem with returning images from a servlet
why this type of error coming?