简体   繁体   中英

Fetch images from a network drive in php

I have a network drive in my intranet with say IP: 128.233.1.15 , which has a shared folder images containing profile images of all the users. Now in my PHP code, I try to fetch individual images of the users dynamically on their successful login from the network drive by making the image path as

$imgdir="file:\\\\\\\\128.233.1.15\\\\images\\\\".$userid.".jpg";

And then I use this $imgdir in <img src> , but the required image is not fetched on the PHP page when a user logs in. But when I directly open the link file:\\\\\\\\128.233.1.15\\\\images\\\\".$userid.".jpg in the web browser, the required image is fetched, but it's not getting fetched by the PHP code.

I have also tried mapping of the network drive and other combinations of the filepath , but it still isn't working.

I think Map your folder as drive if you are on windows. Provide them proper permissions and try again with the drive path.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM