Edgewalker81 Posted June 4, 2007 Share Posted June 4, 2007 I recently created a page on our local network that uses PHP to access a mapped network drive in order to create web galleries of images there. My problem is that I haven't been able to figure out how to display the images. I can't just do something like this: print('<img src="Z:\images\22000.jpg" ....'); Because that won't work, of course. It also doesn't seem to work if I do this: print('<img src="fileserver//images/22000.jpg"...'); I've also tried a lot of variations of each. The second version of this simply causes the page to be stuck loading. The server (apache 2) has permission to access the drive- I can use PHP to get directory listings, access db files, etc. on the drive. Is what I'm trying to do clear? Any help provided would be greatly appreciated, as I don't have much time to make this work. (Isn't that always the way? ) The long story: I have spent a few hours figuring out how to create a working dsn-less connection to any of 120+ MS Access database files and displaying records from them in the page. The database files include paths to (any of about 70,000) images (of the people in the records) that reside next to the database files on the server, and I want to be able to create a page that shows the info along with the person's name & photo. After getting the database side to work, I thought the images would be easy, but it's proving to be the opposite. Edit: Added details Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted June 4, 2007 Share Posted June 4, 2007 the src has to be relative to the client machine... If this an intranet site then every computer would need that drive mapped AND each would have to tag the drive as 'Z'. You solution is to temporarily copy the files to the main server or grab the file contents as a string and echo that via the <img src="/image.php?file=path/to/file" ... method. Image.php would be the script that grabs the file and reads it into a string and all you need then is echo that string. Quote Link to comment Share on other sites More sharing options...
Edgewalker81 Posted June 4, 2007 Author Share Posted June 4, 2007 Temp copies... I was afraid you might say that - we're talking about a quantity of images that approaches a terabyte in total size, and though only a few hundred thumbnails would be loaded at a time, I'm sure that copying them to the server for every client for every page is not going to be a good idea for me. I might try Image.php, but since that's basically the same mechanic in different clothes... Would it just be a wiser choice to convince my boss to let me run an http server process on the fileserver box as well, and just serve up the images that way? Also, it doesn't seem to matter how I refer to the images. If I use the relative mapped path ("z:/complete/path/image.jpg"...) it tells me that "Z:/ is not a protocol" or something similar to that, which is why I think it would be easier to just make the network fileserver into an http server too. Thanks for your help! Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted June 4, 2007 Share Posted June 4, 2007 Hmmmm. I am no server dude BUT if you are using a separate server(s) as long as they are in teh same cluster you shoudl be able to do a bit of magic with either the OS or apachy to prevent you from having to do too much work. Like I said I am not a network fiend but I am absolutley positive it can be done using a cluster... Perhaps a post on the apachy foru will help (Certain this is something more than apachy but there will be network/server dudes in there with the answer). Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.