We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

How to copy a file ?

I want to copy a file to new directory with new name.

Like on first time signup, if user don't upload any image, then the file gets copy from app/public/images/default_pic.jpg to app/public/images/profiles/{username.md5(time())}.jpg.

https://php.net/manual/en/function.copy.php ?

Thanks, I should have remembered this. For future users: this function needs to have file already existed, else it gives an error. For more help checkout comments on the above links.