can't get $file->moveTo("/myFolder") to work

Hi there, When using $file->moveTo("/myFolder") where should the "myFolder" be ? I've tried in the webroot, in public folder also, but with no success.

File is sended but not saved ...



83.0k

The file is internally moved using the function moveuploadedfile (http://php.net/manual/en/function.move-uploaded-file.php), usually the current path is where the bootstrap file is located (public/index.php?), you can get your current path by calling getcwd() (http://www.php.net/manual/en/function.getcwd.php)



29.7k

Hi, thank you for help. I'm sorry, I can't get "moveTo" to work even by providing the file system path to "myFolder". But I've managed the task with moveuploadedfile($file->getTempName(), "images/".$file->getName());