Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

FileNotFoundException

 
Nila dhan
Ranch Hand
Posts: 161
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Nila dhan
Ranch Hand
Posts: 161
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Nila dhan
Ranch Hand
Posts: 161
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic