我正在尝试上传文件并将其放在我的web/uploads/produits/img
目录中,但下面的代码不起作用:
public function getUploadDir()
{
return 'uploads/produits/img';
}
protected function getUploadRootDir()
{
return __DIR__.'/../../../../web/'.$this->getUploadDir();
}
我收到以下错误:
Could not move the file "C:\wamp\tmp\php9265.tmp" to "C:\wamp\www\Projet\src\Arkiglass\ProduitBundle/../../../..\web/uploads/produits/img\." (move_uploaded_file()
[function.move-uploaded-file]: Unable to move 'C:\wamp\tmp\php9265.tmp' to 'C:\wamp\www\Projet\src\Arkiglass\ProduitBundle/../../../..\web/uploads/produits/img\.')
它似乎不知道目录__DIR__.'/../../../../web/'
...