views:

122

answers:

1

Example, move /var/www/1.jpg to /var/www/aaa/1.jpg

+3  A: 

To move a file, you can use rename

If your file is an uploaded one, you'll want to take a look at move_uploaded_file

Here, you'll want to try something like this, I suppose :

rename('/var/www/1.jpg', '/var/www/aaa/1.jpg');


BTW : those two functions are included in PHP, and not specific to symfony ; maybe there is another special way with symfony... But if you have the required permissions to both files and directories, those should work just fine.

Pascal MARTIN