Gossamer Forum
Home : Products : DBMan : Customization :

copying file when adding record

Quote Reply
copying file when adding record
I am trying to copy a file from one directory into another during the add record process and I'm having difficulties with syntax.

My code is cp("$main_path$file_name" $new_path$file_name);

Am I missing something? I continue to get permission error though the file and directory are 777????
Quote Reply
Re: copying file when adding record In reply to
Take the last / off of your $main_path and $new_path variables. Then use

"$main_path/$file_name" $new_path/$file_name

I am not familiar with the syntax you use and maybe it's just fine. My Perl book says that one way to copy files is to use

system("cp $main_path/$file_name $new_path/$file_name");

But your way may work, too.

------------------
JPD