File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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 | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
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: 43

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: 19785
    
  20

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 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: file downloader for image downloading not upto the limit....