[php]
$filename = "D:/pic_gather/figure/1.png";
$size = filesize($filename);
echo $size;
?>
The company has banned the internet, but my work requires external access, so I can only use the company’s public computers. Use your own computer to operate him remotely (you can actually use a proxy, but this method is not used). So some files are on the public machine. However, because I am lazy and don't want to take exams, I choose the folder to be accessed, set it as shared, and then access it with php.
The simple test code is as follows:
The above code implements reading the size of the 1.png file in the pic_gather/figure path shared on a public computer.
Note that the diagonal bar here can only be used with "/" otherwise the access will not be successful. It is also best to use this, so as to make your code compatible with Linux.
Access local resources, the code is as follows:
[php]
$filename = "D:/pic_gather/figure/1.png";
$size = filesize($filename);
echo $size;
?>