[thelist] PHP upload test on members.evolt.org

NanHarbisonSmith at aol.com NanHarbisonSmith at aol.com
Tue Mar 5 06:27:01 CST 2002


--
[ Picked text/plain from multipart/alternative ]
Scott,
I got file uploads to work by using the copy command:

//let the user know if the file upload was successful
if (copy($uploaded_file, $Array[year]."/".$uploaded_file_name))
  {
    print("File was successfully copied.");

        //drop the temp file and print some of the variables for error
checking
        unlink ($minutes_file);
        print ("<br>local file: $uploaded_file<br>\n");
        print ("Name: $uploaded_file_name<br>\n");
        print ("Size: $uploaded_file_size<br>\n");
        print ("Type: $uploaded_file_type<br>\n");

} else {
    print("The file was not uploaded, please try again.");
    }

where the form input was: <input type="file" name="uploaded_file"> and the
folder, which is one level down from where the file is uploaded, is named
2002, and is picked out of the textbox on the form.
Two things that can mess you up:
Did you remember to escape the slashes?
And, the path to the location of where you want to copy the file must be
concatenated. (Meaning--that's how I got it to work after much mucking around
with it)
HTH,
Nan

----------original message --------------------

> Running through a tutorial for PHP, I'm running into the
> simplest of roadblocks:
>
> Does anyone know exactly where / starts for a user/php script?
>
> I believed that once I did a file upload, I move it (using
> move_uploaded_file) to "/~username/public_html/filename" ...
> however it dies every time.  *grrr*
> I've also tried "/home/username/public_html" , and that doesn't
> work either.
>
> Anyone else have this down?
>
> Thanks
> Scott Kennedy
> http://spork.ofdoom.com/skd


Nan Harbison Smith
481 Elm Street
Concord, MA 01742
978-369-1224
978-369-1681

Give a man a fish and you feed him for a day; teach him
to use the Internet and he won't bother you for weeks.





More information about the thelist mailing list