Hi,
I'm working on a project at the moment and I want to allow users to add attachments. I've been looking at how to do this for two days now but the information in the manual and in the books I have is a bit thin on the ground on this topic.
I figured out that I need to store the attachments to a directory on the server and reference them by storing the path in the db.
I'm working on this bit of code that I got from the Wellington and Thompson book, and I seem to have hit a snag.
echo "MailID : $mailid<br/>";
// creating directory will fail if this is not the first message archived
// that's ok
@ mkdir("archive/$list", 0700);
// it is a problem if creating the specific directory for this mail fails
//if(!mkdir("archive/$list/$mailid", 0700))
if(!mkdir("archive/$list", 0700))
{
do_html_footer();
exit;
}
This code originally stored the attachments in a folder that it created called by the mailid. As you can see I changed the mail id aspect to save all attachments to the same folder, which would suit my purposes better, but I got the following error message.
Warning: MkDir failed (File exists) in c:/program files/apache/htdocs/1.otherfiles/pyramid/upload.php on line 79
Is there anyway I can add files to a folder that already exists?