我正在尝试将图像上传到我的 FTP 图像文件夹中。我该怎么做呢?
<html>
<head>
</head>
<body>
<?php
if(isset($_REQUEST['submit']))
{
$filename= $_FILES["imgfile"]["name"];
if ((($_FILES["imgfile"]["type"] == "image/gif")|| ($_FILES["imgfile"]["type"] == "image/jpeg") || ($_FILES["imgfile"]["type"] == "image/png") || ($_FILES["imgfile"]["type"] == "image/pjpeg"))&& ($_FILES["imgfile"]["size"] < 9999999999))
{
if(file_exists($_FILES["imgfile"]["name"]))
{
echo "File name exists.";
}
else
{
move_uploaded_file($_FILES["imgfile"]["tmp_name"],"images/$filename");
echo "Upload Successful . <a href='images/$filename'>Click here</a> to view the uploaded image";
}
}
else
{
echo "invalid file.";
}
}
else
{
?>
<form method="post" enctype="multipart/form-data">
File name:<input type="file" name="imgfile"><br>
<input type="submit" name="submit" value="upload">
</form>