我試圖使用URL文件(PNG)上傳到我的網頁目錄:將文件上傳到我的網頁目錄
$url = "http://api.qrserver.com/v1/create-qr-code/?data=hello_word&size=100x100";
$file = file_get_contents($url);
$fileName = "filename";
$dir = $this->get('kernel')->getRootDir() . '/../web/uploads/img';
$file->move($dir , $fileName);
警告:的file_get_contents(http://api.qrserver.com/v1/create-qr-code/?data=hello_word&size=100x100):未能打開流: HTTP請求失敗! HTTP/1.1 400錯誤的請求
它是如何轉換我的文件,因爲我應該有一個PNG文件 – Achraf