Upload file to share folder/ map folder
-
Hi,
I have two computers C1 and C2 both computers running the same wordpress website and connected to each other using a switch. I can access C1 from C2 in Networks.
I am using a custom plugin in which I am uploading files, each computer upload files in their specific folder, uploads/XYZ.
What I want is to save the uploaded file of C2 to C1 uploads/XYZ folder.
Right now I share and give all permissions to the /XYZ folder of C1 and this folder is accessible from C2.In my code, I provide the shared folder path but it didn’t works, also I made the shared folder as a mapped drive it also not works.
Here is my code:
$upload_dir = '\\C1\XYZ'; if(!is_dir($upload_dir)) mkdir($upload_dir); $img = $_POST['form1_data1']; $name = $_POST['form1_data2']; $img = str_replace('\\', '', $img); $file = $upload_dir .'/'. $name . ".svg"; $success = file_put_contents($file, $img); echo $name; die();
Appreciate your help. Thanks
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Upload file to share folder/ map folder’ is closed to new replies.