I can read files using PHP from a network share, but how can I create a file and folder on a network share?
+1
A:
Same way you would a local file.
$fp = fopen("\\\\server\\share\\folder\\file.txt","w");
You must have permission to create/write, also.
Fosco
2010-07-21 18:37:08
I don't think it works without the slashes. Because `'\\'` is interpreted as the string: `\`... Either way, the extra escaping can't hurt...
ircmaxell
2010-07-21 19:04:27
@ircmaxwell, thanks.. removed that second example.
Fosco
2010-07-21 19:07:25