사용자가 내 웹 사이트에 이미지를 업로드 할 수있는 PHP 웹 응용 프로그램이 있습니다. 단순히 HTML을 사용하여이 작업을 수행하고 있습니다. <form enctype="multipart/form-data">
웹 개발 : 사용자가 내 CDN (Cachefly)에 직접 파일을 업로드하도록 허용하려면 어떻게해야합니까?
그러나 이러한 이미지를 웹 서버에 업로드하는 대신 해당 이미지를 내 CDN (Cachefly - 다른 서버)에 직접 업로드 할 수 있습니다.
가능 : 웹 응용 프로그램에서 다른 서버로 이미지를 직접 업로드 할 수있게하려면 어떻게해야합니까?
$target_path = "/home/www/example.com/uploads/";
$target_path = $target_path . basename($_FILES['uploadedfile']['name']);
if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
// file has been uploaded **LOCALLY**
// HOWEVER, instead of it being upload locally, I would like the file
// to be directly uploaded to the CDN ('other' server)
...
} else{
// error: file did not get uploaded correctly
....
}
원래 게시글에 내 코드를 포함했습니다. – Tim