This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
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?
Joined: Sep 15, 2005
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 ]
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.
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.
Joined: Mar 22, 2005
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.