我试图使用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