Remote file upload help needed
This is my normal file upload code.
HTML
<form action="" method="post" enctype="multipart/form-data" name="form1" id="form1">
<input name="theFile" type="file" />
<input name="Submit" type="submit" value="Upload">
</form>
PHP Variables to receive file
$fileName = $_FILES['theFile']['name'];
$fileTempName = $_FILES['theFile']['tmp_name'];
Now i would like to use remote upload.
So i created a form like this
<form method="POST" action="<?=$self?>">
<input type="text" name="file[]" size="45" value="">
<input name="submit" type="submit" id="submit" value="submit" accesskey="s"></p>
</form>
I have to enter file url in the above form. When i submit the form i want the file file details store in these variables $fileName,$fileTempName
I don't want them to store locally. I'm trying to use those variables in amazon s3 upload. Could you guys help me?. Thanks
尝试这个:
$ch = curl_init("http://www.remotepage.com/upload.php");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CUROPT_POSTFIELDS, array('fileupload' => '@'.$_FILES['theFile']['tmp_name']));
echo curl_exec($ch);
You're trying to make remote upload but wihthout option to reupload it to your server? Why don't you just send your form to your uploading place & proccess it there? It's fastest and the best solution..
链接地址: http://www.djcxy.com/p/64854.html上一篇: PHP图片上传
下一篇: 需要远程文件上传帮助