upload file on drive d:// php

2019-09-21 16:26发布

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.

2条回答
劫难
2楼-- · 2019-09-21 16:46

Yes you can do something like

 copy('C:/Program files/zend/apache/htdocs/myWeb', 'D:/attached file/web/file.jpg');
查看更多
放我归山
3楼-- · 2019-09-21 16:47

Specifies the file with drive path in move_uploaded_file() method

move_uploaded_file($_FILES["file"]["tmp_name"],  "D:/somefolder/" . $_FILES["file"]["name"]);
查看更多
登录 后发表回答