Re: anyone have HTML snippet example of HTTP method = put?
| From: | mike | Date: | Sat, 02 Aug 2008 18:12:13 +0000 |
| Subject: | Re: anyone have HTML snippet example of HTTP method = put? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-277633@lists.php.net to get a copy of this message | ||
On 8/2/08, Benjamin Hawkes-Lewis <bhawkeslewis@googlemail.com> wrote:
> I can appreciate why one might imagine otherwise, but XHTML 1.x forms only
> support GET and POST. GET and POST are the only allowed values for the
> "method" attribute.
Sigh. That makes sense then.
So to test my script I need to use curl or something, I was hoping to
test my browser directly. I thought at least PUT would work. Obviously
not every DAV command or anything else.
> There are proposals to add PUT and DELETE to the supported methods in a
> future version of HTML.
Well, I won't actually be using this in production this way anyway, I
just wanted to do some testing at home using PUT first. Looks like I
will have to use curl or another method that isn't in-browser.
> Hard to be sure, but judging from your markup, you might well be using the
> wrong HTTP method anyway. The "action" attribute specifies where the URL the
> form submits to. In the case of a PUT method, the server is supposed to
> replace the resource represented by that URL with the entity dispatched in
> the request:
Yeah - that is why I had set my webserver as dav_access readonly. I
was wanting to see it first PUT the file, see if PHP accepted it, or
it just said "access denied"
I need to PUT a file but use a PHP script as a wrapper, and my
webserver is nginx.
> I note in passing that if you're intending to use that markup in production,
> you should really enclose the text "File: " in a "label" element associated
> with the "input" element by having a "for" attribute matching an
> "id"
> attribute adding to the "input". This will allow user agents to accurately
> associate the label with the file upload control, for example screen readers
> and voice browsers can speak or braille "File: " when the focus enters the
> control. For a detailed explanation, see:
Thanks for the tip.