Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Servlet and FileInputStream

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,
I try to read a binary file with a servlet. It's working well when i read a local file. The syntax is like that
in = new FileInputStream("d:/xxxxx/file.yyy");
My problem occur when the filename include a machine-name.
in = new FileInputStream("//machinename/d$/xxxxx/file.yyy");
I run the same code in java not with servlet and it's working. What can be the problem.
Thanks
 
Steve Wall
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just bumped into the same problem here is the snipped of my code. Whe I try to run it I get a file not found found exception.
Can anyone please tell me what the problem is.
String fileURL = "http://www.nfl.com/matchup.html";
BufferedReader fileStream = new BufferedReader(new FileReader(fileURL));
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic