如何使用ftp将图像从客户端浏览器上传到服务器计算机。 我曾经在同一台机器(SERVER)上传图像,但我不知道如何从客户机上传图像
答案 0 :(得分:0)
这将帮助您解决问题 https://wiki.filezilla-project.org/FileZilla_Client_Tutorial_(en)
使用浏览器上传文件:
HTML部分:
<form action="uploaddb.php" name="entryform" method="POST" enctype="multipart/form-data">
<input type="file" name="file"><input type="submit" name="submit" value="Upload"></form>
uploaddb.php
if ($_FILES["file"]["error"] > 0){
echo "<script>alert('Please Select File');
location = 'upload.php';
</script>";
exit();}else{if (file_exists("uploads/" . $_FILES["file"]["name"])){
echo "<script>alert('File Already Exists');
location = 'upload.php';
</script>";
exit() }else
{
move_uploaded_file($_FILES["file"]["tmp_name"],
"uploads/" . $_FILES["file"]["name"]);
echo "<script>alert('File Uploaded Successfully');
location = 'upload.php';
</script>";
exit();
}}
创建名为&#34的文件夹;上传&#34;