upload file on drive d:// php

2019-09-21 16:28发布

问题:

I want to upload files from apps running on the local computer to another drive outside the drive where my application's root folder. Here I include the folder structure:

  • root app: C: // Program files / zend / apache / htdocs / myWeb

This is the file destination path I want to upload: D: // attached file / web / file.jpg

Hope you can help me.

回答1:

Yes you can do something like

 copy('C:/Program files/zend/apache/htdocs/myWeb', 'D:/attached file/web/file.jpg');


回答2:

Specifies the file with drive path in move_uploaded_file() method

move_uploaded_file($_FILES["file"]["tmp_name"],  "D:/somefolder/" . $_FILES["file"]["name"]);