파일을 box.net에 업로드하는 중입니다. Curl을 사용하여 파일을 보내고 있습니다.원하는 파일 대신 .tmp 파일을 서버에 업로드
하지만 내가 직면 한 문제는 내가 선택한 파일을 업로드하지 않고 일부 .tmp 파일을 업로드한다는 것입니다. 내가 잘못 어떤 일을하고
<?php
$upload_url = 'Server-Url';
$tmpfile = $_FILES['new_file1']['tmp_name'];
$_POST['new_file1'] = '@'.$tmpfile;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $upload_url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $_POST);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
<form action=""
enctype="multipart/form-data" accept-charset="utf-8" method="POST">
<input type="file" name="new_file1" />
<input type="text" name="share" value="1" />
<input type="submit" name="upload_files" value="Upload File" />
</form>
암 :
다음은 내 코드입니다? 이 문제를 해결하려면 아무도 도와주세요.
Uhm ... tmp 파일 *은 * 파일이며, 업로드하는 동안 항상 tmp 파일로 이름이 바뀌 었습니다. – deceze
@deceze 어쨌든 원래 파일 이름으로 되돌릴 수 있습니까? –