PHP access to network shared resources and local files
The company banned the net, but my work needs external network, so can only use the company's public computer. Use your own computer to remotely manipulate him (in fact, you can get an agent, but not in this way). So some files are on the public machine above, however, because I am more lazy, do not want to test to go, so the use of the folder will be accessed, set to share, and then access with PHP access.
The simple test code is as follows:
<meta http-equiv= "Content-type" content= "TEXT/HTML;CHARSET=GBK" ><?php$filename = "//192.168.1.31/pic_ Gather/figure/1.png "; $size = FileSize ($filename); Echo $size;? >
The above code is implemented by reading the size of the 1.png file under the shared Pic_gather/figure path under the public computer.
Note that the diagonal bar here can only be used "/" otherwise the access is unsuccessful. It's also best to do this so that your code is compatible with Linux.
To access local resources, the code is as follows:
<meta http-equiv= "Content-type" content= "TEXT/HTML;CHARSET=GBK" ><?php$filename = "D:/pic_gather/figure/1. PNG "; $size = FileSize ($filename); Echo $size;? >