0

我正在生成一个小脚本,它操作文件名、重命名文件并将其移动到当前目录中的目录。

问题(我认为)是我正在从我的计算机上运行一个本地PHP 脚本并试图让它在网络驱动器上进行操作(在这种情况下为 R:\)

我决定,因为我使用的是 Windows 7,所以我将使用rename()函数。这是代码片段..

if (!empty($_REQUEST['uploaded_file']))
    rename("R:\\".$fileName, "R:\\Movies\\".$newFileName);

注意:$filename$newFileName在脚本的前面被拉取

产生的错误是:

Warning: rename(R:\movie.title.2011.avi,R:\Movies\Movie Title [2011].avi):
                      The system cannot find the path specified. (code: 3)

该代码曾经工作了一段时间,但出于某种原因,突然之间,它不想再工作了。

我不确定使用重命名方案是否是完成此任务的最佳方法。我的 Synology DS1010+ 不喜欢我使用 SFTP 连接和重命名太多次。它最终开始拒绝连接,所以我需要这样做不同..

环境信息:

操作系统:

  • Windows 7 旗舰版 x64
  • PHP版本:5.4.4

FileZilla 连接尝试:

Status: Connecting to 192.168.5.25:21...
Status: Connection established, waiting for welcome message...
Response:   220 Diniz-Stora FTP server ready.
Command:    USER admin
Response:   331 Password required for admin.
Command:    PASS **********
Response:   230 User admin logged in.
Status: Connected
Status: Retrieving directory listing...
Command:    PWD
Response:   257 "/" is current directory.
Command:    TYPE I
Response:   200 Type set to I.
Command:    PASV
Response:   227 Entering Passive Mode (24,63,165,211,217,0)
Command:    LIST
4

0 回答 0