PHP:文件上传move_uploaded_file()方法不适用于IIS7

时间:2014-07-19 18:07:55

标签: php

当我使用XAMPP服务器和MySQL数据库时,它正在工作,但我必须使用MSSQL数据库IIS7服务器,它无法正常工作。请参阅这是html表单:

<form action="bookentry.php" enctype="multipart/form-data" name="myForm" id="myform" method="post">
   <table width="90%" border="0" cellspacing="0" cellpadding="6">
      <tr>
        <td align="right">Book Image</td>
        <td>
        <label>
            <input type="file" name="fileField" id="fileField" />
        </label>
        </td>
      </tr>      
      <tr>
     <td>&nbsp;</td>
     <td>
      <label>
    <input type="submit" name="button" id="button" value="Add This Book Now" />
     </label>
     </td>
     </tr>
   </table>
   </form>

这是php代码

<?php
    $bid="MyImageName";
    $newname = "$bid.jpg";
    move_uploaded_file( $_FILES['fileField']['tmp_name'], "../inventory_images/$newname");
    header("location: inventory.php"); 
    exit();
?>

我不明白这个问题及其发生的地方!

1 个答案:

答案 0 :(得分:1)

检查您是否write permission到您尝试移动该文件的文件夹。(inventory_images)。

修改

根据您的评论检查windows操作系统中的权限:

right click该文件夹转到properties,然后转到security tab

您也可以通过查看checkbox然后点击apply按钮来提供权限。

以下是帮助屏幕截图:

enter image description here

相关问题