Hello, Julian C Stevens wrote: > > 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).
AFAIK, the PUT method is not for uploading via form, but rather some page editors like Netscape Composer and Amaya. To upload via form, use method POST with encoding type set to multipart/form-data . You may find an example here: http://phpclasses.UpperDesign.com/browse.html/package/1 Regards, Manuel Lemos -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]