tags:

views:

32

answers:

2

Hi i am using libmail to send mails. In File Attachment Php File Upload is not working Because libmail attachment function only focus the local path . So It is possible to copy a file from one folder to another. Is It Possible Please Guide me. Thanks in advance

A: 
rename('path/to/file/file.ext', 'path2/to2/file2/file.ext');
Alexander.Plutov
actually this syntax move the file, use the copy() function instead (same parameters: http://php.net/manual/en/function.copy.php)
Cesar
+1  A: 

Use the copy() in php.

copy('path/to/original/text.txt', 'path/to/destination/text.txt');

http://php.net/manual/en/function.copy.php

rename() is for actually renaming a file.

etbal