copy 函数是从系统的临时目录里copy的,直接从e盘copy传到服务器上当然不好使,因为服务上没有这个e盘的路径。userfile是表单中文件的名字。$_FILES['userfile']['name']
客户端机器文件的原名称。
$_FILES['userfile']['type']
文件的 MIME 类型,需要浏览器提供该信息的支持,例如“image/gif”。
$_FILES['userfile']['size']
已上传文件的大小,单位为字节。
$_FILES['userfile']['tmp_name']
文件被上传后在服务端储存的临时文件名。
$_FILES['userfile']['error']
可以用$uploadfile_name\$uploadfile_type等等来解决,upload代表上传文件,例如问题中的:pic
客户端机器文件的原名称。
$_FILES['userfile']['type']
文件的 MIME 类型,需要浏览器提供该信息的支持,例如“image/gif”。
$_FILES['userfile']['size']
已上传文件的大小,单位为字节。
$_FILES['userfile']['tmp_name']
文件被上传后在服务端储存的临时文件名。
$_FILES['userfile']['error']
可以用$uploadfile_name\$uploadfile_type等等来解决,upload代表上传文件,例如问题中的:pic
copy($ima,$pic);
$ima为表单中
<input name="ima" type="file" id="ima">的name这样写得先确保你的register_globals = On
$temppath = str_replace("\\","/", $fileName);
if(!move_uploaded_file($temppath,$destfile))
{
echo ("error");
return;
}
$temppath = str_replace("\\","/", $tempfile);
if(!move_uploaded_file($temppath,$destfile))
{
echo ("error");
return;
}要注意windows系统与unix系统的区别,即'\\'转换为'/'。
虎翼网上调试成功