Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP Create File on Network Share

I can read files using PHP from a network share, but how can I create a file and folder on a network share?

like image 855
adsad Avatar asked Nov 27 '25 19:11

adsad


1 Answers

Same way you would a local file.

$fp = fopen("\\\\server\\share\\folder\\file.txt","w");

You must have permission to create/write, also.

like image 51
Fosco Avatar answered Nov 30 '25 09:11

Fosco



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!