Re: How I got PHP under Windows to upload a file
| From: | Maxwell Hung | Date: | Mon, 26 Jun 2000 13:15:44 +0000 |
| Subject: | Re: How I got PHP under Windows to upload a file | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-652@lists.php.net to get a copy of this message | ||
which version of windows is this using??
It doesn't work with apache on win95.
M@X
--- Adrian Teasdale <adrian@inovica.com> wrote: > Hi
all - just thought I'd put something back into
> the community :)
>
> I had a question a week or so ago about file uploads
> under Windows. I have
> managed to solve this and I thought I would share
> this as the question came
> up yesterday again....
>
> Within PHP.ini I put the file upload file settings
> to:
>
> upload_tmp_dir = /Windows/Temp/
>
>
> and then I tried this test code:
>
> <?
>
> // check for file upload
>
> if(isset($uploadedfile))
> {
>
> // copy the uploaded file to a different location -
> in this instance
> // to the c: drive.
> copy ($uploadedfile, "c:\\$uploadedfile_name");
>
> // just echo some variables back to the screen
> echo "local file: $uploadedfile<br>";
> echo "Name: $uploadedfile_name<br>";
> echo "size: $uploadedfile_size<br>";
> echo "Type: $uploadedfile_type<br>";
> }
> ?>
>
> <form action ="<?php echo $PHP_SELF ?>"
> method="post"
> ENCTYPE="multipart/form-data">
> <input type="hidden" name="MAX_FILE_SIZE"
> value="5000000">
> <input name="uploadedfile" type="file">
> <input type="submit" value="upload">
> </form>
>
> </body>
> </html>
>
> Make sure that you copy the file from the temp
> directory to wherever you
> want it to be before it is deleted!. I did this
> with:
>
> copy ($uploadedfile, "c:\\$uploadedfile_name");
>
> I hope that this helps someone out - this is a
> problem which has been
> bugging me now for around a year!!!!
>
> All the best to everyone and have a good weekend
>
> Ade
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail:
> php-windows-unsubscribe@lists.php.net
> For additional commands, e-mail:
> php-windows-help@lists.php.net
> To contact the list administrators, e-mail:
> php-list-admin@lists.php.net
>
__________________________________________________
Do You Yahoo!?
Get Yahoo! Mail - Free email you can access from anywhere!
http://mail.yahoo.com/