Using PUT method for upload
| From: | Stevens, Julian C | Date: | Wed, 16 Jan 2002 18:41:42 +0000 |
| Subject: | Using PUT method for upload | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-11476@lists.php.net to get a copy of this message | ||
I'm using Apache 1.3.20 and PHP 4.1.1 on Windows NT 4 to run a website that
users can upload files to.
I am currently using an HTML form with an <INPUT type="FILE" ...> field.
However, for auditing purposes, I need to restrict where users are allowed to
upload FROM as well as TO.
The HTML form offers a browse button that can roam around the entire
filesystem and I can see no way of restricting this.
I have put together a PHP script that enables me to offer a restricted browse
function which then returns the name of the selected file to the calling
program.
My question is can I use PHP to upload the file, without using the HTML form
method?
The PHP manual suggest PUT as an alternative upload method, but I can't see
how to implement it.
The manual has an example PUT request which looks like this:
PUT /path/filename.html HTTP/1.1
But where and how do I run this command, and where does it get the name of the
file I want to upload (assuming /path/filename.html is the target location on
the webserver).
Can anyone enlighten me please? In general I have found the PHP manual
excellent, but I can't seem to follow this section.
Thanks,
Julian
********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************