在iss7中无法使用php上传图像

时间:2014-05-13 10:26:32

标签: php upload windows-server-2008 file-permissions

我无法将图片上传到我的服务器(iss7)我正在使用的PHP代码

if (isset($_POST['submit'])) {

    $image = addslashes(file_get_contents($_FILES['image']['tmp_name']));
    $image_name = addslashes($_FILES['image']['name']);
    $image_size = getimagesize($_FILES['image']['tmp_name']);

    move_uploaded_file($_FILES["image"]["tmp_name"], "/jobs/upload/" . $_FILES["image"]["name"]);
    $location = "/jobs/upload/" . $_FILES["image"]["name"];

    mysql_query("insert into jobs (location) values ('$location')") or die(mysql_error());
    if (is_uploaded_file($_FILES['userfile']['tmp_name'])) {
        echo "File ". $_FILES['userfile']['name'] ." uploaded successfully.\n";
    }
}

我收到以下错误:

Warning: move_uploaded_file(/jobs/upload/sig.png) [function.move-uploaded-file]: failed to        open stream: No such file or directory in C:\Inetpub\vhosts\####.co.uk\httpdocs

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move 'C:\Windows\Temp\php6D8A.tmp' to '/jobs/upload/sig.png' in C:\Inetpub\vhosts\####.co.uk\httpdocs\content\jobs\photos.php on line 76

我尝试过设置文件夹的权限

C:\inetpub\vhosts\mywebsite.com\httpdocs\content\
C:\WINDOWS\Temp\

0 个答案:

没有答案