我在我的网站上上传文件时遇到问题,因为我是 php 新手。请帮助我解决这个问题。这是我的代码:当我尝试运行此代码时,它给了我错误 move_uploaded_file(/www.g-dms .com/livelink/livelink.exe?func=ll&objId=59413694&objAction=browse&viewType=1/Lighthouse.jpg) [function.move-uploaded-file]:无法打开流:C:\xampp\phpMyAdmin\filefile 中没有错误。第 30 行的 php
<?php
$dir = "/www.g-dms.com/livelink/livelink.exe?func=ll&objId=59413694&objAction=browse&viewType=1/";
$types = array("image/gif","image/jpeg","image/jpg","application/x-zip-compressed");
//Check to determine if the submit button has been pressed
if(isset($_POST['submit'])){
//Shorten Variables
$tmp_name = $_FILES['upload']['tmp_name'];
$new_name = $_FILES['upload']['name'];
//Check MIME Type
if (in_array($_FILES['upload']['type'], $types)){
//Move file from tmp dir to new location
move_uploaded_file($tmp_name,$dir . $new_name);
echo "<strong>{$_FILES['upload']['name']} was uploaded sucessfully, we will be touch!</strong>";
}else{
//Print Error Message
echo "<small>File <strong><em>{$_FILES['upload']['name']}</em></strong> was not uploaded</small><br />";
//Debug
$name = $_FILES['upload']['name'];
$type = $_FILES['upload']['type'];
$size = $_FILES['upload']['size'];
$tmp = $_FILES['upload']['name'];
echo "Name: $name<br/ >Type: $type<br />Size: $size<br />Tmp: $tmp";} }
else{
echo '';
}
?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" enctype="multipart/form-data">
<fieldset>
<div style="padding-left: 90px;"><input type="file" name="upload" /> </div>
</fieldset>
<br>
<input type="submit" name="submit" value="Upload File" /> </center>
</form></div></body></html>