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 ...



85.3k

The file is internally moved using the function move_uploaded_file (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)



31.2k

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 move_uploaded_file($file->getTempName(), "images/".$file->getName());