2014-07-19 51 views
-2

当我使用XAMPP服务器和MySQL数据库时,它工作,但我必须使用MSSQL数据库IIS7服务器,它不工作。看到这是HTML表单:PHP:文件上传move_uploaded_file()方法不适用于IIS7

<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

检查您是否有write permission到您想要移动该文件的文件夹(inventory_images)。

编辑

按你的意见来检查windows OS权限:

right click该文件夹去properties,然后通过简单的检查去security tab

从,你也可以给你许可checkbox然后点击apply按钮。

下面是屏幕截图的帮助:

enter image description here

+0

如何获得写权限? – mhtamun

+0

@mhtamun,看看编辑 –

+0

不适合我。 – mhtamun

相关问题