I just can get the temp file path,like D:\XAMPP\tmp\phpE185.tmp...But the $_FILE array is null,because I do a transport from a url to another url.So how to move this temp file?
here is my code:
class UserController extends Controller
{
public function getRank(){
echo "waht";
}
public function uploadTrans(Request $request){
$image = $request->image;
$name = $request->name;
$image = urlencode($image);
$curlPost = "name=$name&image=$image";
$uploadApi = "http://mdx.ittun.com/authprac/public/upload";
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,$uploadApi);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch,CURLOPT_POSTFIELDS,$curlPost);
$output = curl_exec($ch);
curl_close($ch);
echo $output;
}
public function upload (Request $request){
$fileTempName = $request->image;
print_r($fileTempName);
// here I just can get the temp file path..$_FILES array is null
}
}