Jump to content

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/54133-displaying-images-from-mapped-drive/
Share on other sites

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.

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!

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).

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.