我写的一段文件上传程序,是php的程序如下:<?php$uploaddir = '/form/upload/file/';$uploadfile = $uploaddir. $_FILES['userfile'] ['name'];print "<pre>";if (move_uploaded_file($_FILES['userfile'] ['tmp_name'], $uploadfile)) {print "上传成功!下面是调试信息:\n";print_r($_FILES);} else {print "上传失败,以下是调试信息:\n";print_r($_FILES);}print "</pre>";?>结果出现如下错误,怎么解决?Warning: move_uploaded_file(/form/upload/file/IPMSG.exe): failed to open stream: No such file or directory in f:\我的学习\it\php\web\form\upload\upload-2.php on line 13Warning: move_uploaded_file(): Unable to move 'D:\DOCUME~1\alexzhao\LOCALS~1\Temp\php96.tmp' to '/form/upload/file/IPMSG.exe' in f:\我的学习\it\php\web\form\upload\upload-2.php on line 13
參考答案:$uploaddir = '/form/upload/file/';
改成
$uploaddir = './form/upload/file/';
$uploaddir = '../form/upload/file/';
试试。