aspose file tools*
The moose likes Java in General and the fly likes FileNotFoundException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "FileNotFoundException" Watch "FileNotFoundException" New topic
Author

FileNotFoundException

Nila dhan
Ranch Hand

Joined: Sep 15, 2005
Posts: 160
I have a compressed file which i have to decompress.I use html tag to provide the file as the input.But my application throws file not found exception when processed.What could be wrong.Any ideas?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41874
    
  63
Lets see if I understand this right. You have a compressed file on your local disk. You're writing a Java application that should do the decompressing, and it can't find the file in question. How do you specify the file in your program?

And: where does HTML enter the picture?


Ping & DNS - my free Android networking tools app
Nila dhan
Ranch Hand

Joined: Sep 15, 2005
Posts: 160
i use the html input type='file' tag in my jsp to provide the file as input.Hope you understood now.And the compressed file is a full database which resides in a linux machine and i compress the database via my application and store it to my local disk.Is there any permission issue in the linux machine that would make the compressed file unreadable??

[ November 09, 2005: Message edited by: Nila dhan ]
[ November 09, 2005: Message edited by: Nila dhan ]
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24184
    
  34

The JSP has a file-upload input field. The user picks a file, and when they submit a form, the file data is sent to the server. Then, it's up to your program to receive that data and save it somewhere. Then the file will be available for your compression program. So just make sure you successfully save the file data someplace you have permission to write.

If you are handling the upload data, a common mistake is to assume the current directory is your webapp home, or the server home, or something else along those lines. There's absolutely no guarantee what the current directory is, or that you'll have write access to it. You need a special data directory at a well-known absolute path to work with.


[Jess in Action][AskingGoodQuestions]
Nila dhan
Ranch Hand

Joined: Sep 15, 2005
Posts: 160
I face no problem in compressing the file.But it the decompression part which throws the exception.The decompression part works fine in my local server.But when uploaded to the linux server, it throws the exception.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41874
    
  63
Re-read Ernests post. The problem is likely that the file is not where your code thinks it is. Make sure you are accessing the correct directory.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: FileNotFoundException