Php 警告:移动上传的文件()错误

Php 警告:移动上传的文件()错误,php,function,phpmyadmin,Php,Function,Phpmyadmin,我正试图上传一个与php相关的用户配置文件的配置文件图片,但每次我使用move\u uploaded\u file时都会出现错误,我已经测试了所有标准程序: 以下是我正在使用的代码: function change_profile_image($row, $file_temp, $file_extn) { $file_path = 'images/profile/' . substr(md5(time()), 0, 10) . '.' . $file_extn; move_uploaded_fi

我正试图上传一个与php相关的用户配置文件的配置文件图片,但每次我使用
move\u uploaded\u file
时都会出现错误,我已经测试了所有标准程序:

以下是我正在使用的代码:

function change_profile_image($row, $file_temp, $file_extn) {
$file_path = 'images/profile/' . substr(md5(time()), 0, 10) . '.' . $file_extn;
move_uploaded_file($file_temp, $file_path);
}
?>
我不断地发现这些错误:

警告:移动上传的文件(images/profile/f3582c5d28.png):无法打开流:第20行的C:\xampp\htdocs\cricket\user\edit.php中没有此类文件或目录
警告:move_uploaded_file():无法将C:\xampp\tmp\php2857.tmp移动到C:\xampp\htdocs\cricket\user\edit.php第20行中的“images/profile/f3582c5d28.png”


使用完整路径,即:

function change_profile_image($row, $file_temp, $file_extn) {
$file_path = 'C:/xampp/htdocs/hello/user/images/profile/' . substr(md5(time()), 0, 10) . '.' . $file_extn;
move_uploaded_file($file_temp, $file_path);
}
确保dir
C:/xampp/htdocs/hello/user/images/profile/
可由php编写


文件和文件夹权限 在NTFS卷上,您可以设置文件和卷的安全权限 文件夹。这些权限授予或拒绝对文件和 文件夹。您可以按查看文件和文件夹的安全权限 完成以下步骤:

In Windows Explorer, right-click the file or folder you want to work with.

From the pop-up menu, select Properties, and then in the Properties dialog box click the Security tab.

In the Name list box, select the user, contact, computer, or group whose permissions you want to view. 
如果权限变暗,则表示权限是从父对象继承的


这个错误信息非常清楚。你走错路了谢谢你的流浪汉,我到底是怎么走错的?我想将图像保存在存在的文件夹中?查看
$file\u temp
包含的内容会有所帮助。我想这就是你的问题所在。这是一个临时存储文件的变量。谢谢你的输入。佩德罗,我现在来试试。我如何检查dir C:/xampp/htdocs/hello/user/images/profile/是否可写?抱歉,我的知识不是那么先进,但我正在尝试我的最佳做法。Pedro,我只是尝试了完整路径$file_path='C:/xampp/htdocs/hello/user/images/profile/',但它仍然给我相同的错误Spedro只允许整个文件夹具有完整权限,仍然给我相同的错误:(暂时,请授予用户“everyone”对该文件夹的所有权限,然后重试。