나는 다음과 같은 코드를 사용하여 원격 서버에서 이미지를 복사하기 위해 노력하고있어에 이미지를 복사 :한 서버에서 다른 서버로 사용하여 PHP
:Warning: file_put_contents(/server/location/upload/) [function.file-put-contents]: failed to open stream: Is a directory in /server/location/myscript.php on line 220
$src = "http://www.imagelocation.com/image.jpg";
$dest = "/server/location/upload/";
file_put_contents($dest, file_get_contents($src));
불행히도 나는 다음과 같은 오류가 계속
이 문제를 해결하는 방법에 대한 아이디어가 있으십니까?
완벽하면이 예제가 실제로 도움이됩니다. 고맙습니다! 또 다른 메모에서 사본이 성공했는지 어떻게 해결할 수 있습니까? – David
사용 $ check = file_put_contents ($ dest, file_get_contents ($ src)); 그리고 $ check 값을 살펴보십시오. http://php.net/manual/en/function.file-put-contents.php : 이 함수는 파일에 기록 된 바이트 수를 반환하고 실패하면 FALSE를 반환합니다. – Daan