我正在尝试执行文件上传,并且正在生成一条路线来告诉move_uploaded_file
将文件移动到哪里。在我的路由文件中(从包中)我有:
endorsement_pics:
pattern: /images
defaults: { _resource: EndorseMeEndorsementBundle/Resources/public/images/endorsement_images }
我这样做:
$url = $this->get('router')->generate('endorsement_pics');
生成文字网址 www.example.com/endorsement/images
和功能
move_uploaded_file($_FILES['endorsement_image']['tmp_name'], $url."image1.jpg");
这给了我错误:
Warning: move_uploaded_file(/newsite/web/app_dev.php/endorsement/imagesimage1.jpg) [<a href='function.move-uploaded-file'>function.move-uploaded-file</a>]: failed to open stream: No such file or directory in /home/content/24/9254124/html/newsite/src/EndorseMe/EndorsementBundle/Controller/DefaultController.php line 20
有任何想法吗?