Re: copying files...? Nope, uploading
| From: | Mike Flynn | Date: | Mon, 01 Oct 2001 14:16:51 +0000 |
| Subject: | Re: copying files...? Nope, uploading | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-9633@lists.php.net to get a copy of this message | ||
You don't "copy" files from a user's PC through the web. The web doesn't
allow the "copying" of files. What you can do, if the user's browser supports it, is
support file UPLOADS through the form. PHP has robust support for this and I've used it just
fine for a whole bunch of different stuff. Takes a little time to get the hang of it, but once you
understand what's going on, it's a snap.
To begin, check out:
http://www.php.net/manual/en/features.file-upload.php
Then do some searches on the web for "php file upload" .. I'm sure all the big sites
(devshed, zend, phpbuilder) have plenty of articles on PHP file uploads.
If you'd like some sample code, just ask.
-Mike
At 01:07 PM 10/1/2001 +0200, you wrote:
>I want to copy a file from a users PC (via a form) to a specific folder on the webserver and
>store the file name in the Database.
>I have tried to use the copy($string, $path) function but I keep getting errors.
>
>Does anyone know a simplat solution for this? Do I have to copy the contents of the file to a
>temp file on the server first? If so how?
>Or is there another function to do what I require?
>
>thanks,
>
>Andrew
-=- Mike Flynn - Burlington, VT -=-
mike@mikeflynn.net http://www.mikeflynn.net/ * Give blood
*
...maintaining lawns, watching televised sports, birthing
children, listening to Top 40 music, and collecting
stuffed animals...