Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Reading files from network  RSS feed

 
Lucas Sanabio
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone.

I developed an application for a photography company which besides all the business logic, they have one server which has some rude hard drivers where they keep the original photos from lots of events and I have a folder on the web server which has the same structure of each event's folders but all the photos are smaller(thumbs).

So, when ther custumers come to chose the photos they use this system which enable then to do some efects with the photo, and all the photos are show by the thumbs forder, this is working just fine.

The problem is, when the customer has choose the photos, my client can generate a zip from my system with all ORIGINAL photos that the user choose, so that he don't need to keep lookin at lots of photos to get the ones que wants.

There is the problem, when I'm generating this zip, the web server has to read this photos from de network and add then to the zip, but it is telling me that the file does not exist, but it does.

I tried using de File.separator to make the path, I tried to do it by an constant(the server is windows), and it always telling me that it cannot find the file. If I get the path which a logged and paste it on the browser, it shows me the photo.

Well, the worst thing is that is only happining now that we changed the server, before it, it was running on other windows server too, and it was working just fine.

I don't know nothing that could make java not seen a mapped hard driver.

I'm using tomcat 5.5, jdk1.5. The server is a Windows 2003 server.

Any ideas? :-(
 
Joe Ess
Bartender
Posts: 9425
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you give us an example path?
 
Lucas Sanabio
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One exemple:

Z:\espacofotografico\2007\formaturas\Engenharia Civil\baile\AIKON 001.jpg

Z is a mapped hard driver.

Let me paste the code I use below:



Before this, I had the same problem to access a MS Access database, which I need to integrate with an old system that they use. When I tried to access the database from the network it could not find the database, with the same code, just changing the path to a local path and copying the same database to local machine, the application just started connecting to the database.
 
Paul Clapham
Sheriff
Posts: 22374
42
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Lucas Sanabio:
Z is a mapped hard driver.
Usually mapped drives only belong to processes that are signed on and have a display. If you are running your server as a service (and you almost certainly are) then it will not have any mapped drives.

You can use a UNC path to the share where you would normally map instead, for example something like this:
 
Lucas Sanabio
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Paul.

I didn't find the reason it was not working. As I said it was working just fine and I was using the paths z:\ (mapped drivers). So what we did to solve it was to try to install the windows 2000 server again and it worked. I don't know why, but it just didn't work on 2003 server.

Thanks!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!