On 2/5/02 9:58 AM, "Todd Williamsen" <[EMAIL PROTECTED]> wrote:
> Now I have two small issues...
> 
> 1.  How would I automate the file naming otherwise errors will fly (can't
> copy file... blah blah)

You could replace the file name with a randomly generated number. There are
a number of ways to generate random numbers in PHP. Try this for starters:

http://www.php.net/manual/en/function.mt-rand.php
 
> 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...

You need the path from root to the directory. Now you have:

"home/sites/madden.williamsen.net/web/recruiter/resumes/$img1_name"

You need a forward slash before home:

"/home/sites/madden.williamsen.net/web/recruiter/resumes/$img1_name"

Instead of using chmod 777 (ick!) you should change the ownership of the
file to be owned by the web server user which is usually "nobody" you can do
this with the chown command from the command line.

Robert
> 
> 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
> 
> 
> 


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to