File Uploading... Two problems...

From: Date: Tue, 05 Feb 2002 14:58:06 +0000
Subject: File Uploading... Two problems...
Groups: php.db 
Request: Send a blank email to php-db+get-16525@lists.php.net to get a copy of this message
I have been successfully able to upload the files to the server and its path stored in the database.. Now I have two small issues... 1. How would I automate the file naming otherwise errors will fly (can't copy file... blah blah) 2. The second part is the most annoying. It seems that I cannot get the script to put the files into a directory I specify only where the script resides. I thought it was a permission issue, but the folder has been chmod to 777 and it still won't do it... Directory structure home web recruiter < --- folder where the scripts reside resumes <-- the destination where I want the uploaded files to reside here is the code... <? // if $img_name isn't empty, try to copy the file if ($img1_name != "") { // copy the file to a directory or //die and print an error message // NOTE! if you're on a Windows machine, // use Windows pathnames, like so: // copy("$img1", "C:\\some\\directory\\path\\$img1_name"); copy("$img1", "home/sites/madden.williamsen.net/web/recruiter/resumes/$img1_name") or die("Couldn't copy the file!"); } else { // if $img_name was empty, die and let us know why die("No input file specified"); } ?> thanks

« previous php.db (#16525) next »