More stupid Multipart form questions :)

Dave Cragg dcragg at lacscentre.co.uk
Mon Sep 19 02:59:27 EDT 2005


On 18 Sep 2005, at 21:56, david bovill wrote:


>
> More help appreciated with simple form stuff:
>
> <form enctype='multipart/form-data' action='mailtool.php'  
> method='post'>
> <p><input type='file' name='infile' size='40' accept='text/plain'  
> maxlength='500000' accesskey='f'></p>
> <p><input type='checkbox' name='notes' value='yes' checked>
>  Add non comparable fields to field <i>notes</i></p>
>
> <p><input type='submit' value=' convert '>
>    <input type='reset' value=' cancel '></p>
> </form>
>
> I guess "tEnc" would be the mime-type "text/plain"

In your previous example, tType would be "text/plain". However, this  
might not be necessary to set as I think this is the default. Same  
for the encoding.



> and that there is nothing in the library for the:
>
>     maxlength='500000' accesskey='f'

These are html attributes for the browser.


>
> or the:
>
>     name='infile' size='40'
>
> bit?
>

The "name" attribute is needed. Using your example, it should look  
like this:

   if libUrlMultipartFormAddPart(tForm,"infile", tFile, tType, tEnc)  
is empty then

The "size"attribute is for the browser.

> And in general does it matter the order these parts are sent?

No, I don't think so.

>
> It would be real very very nice to have a single comprehensive  
> example of a complex multipart form and the equivalent sent by rev?

Probably a good idea. Meanwhile, below is the rfc for the multipart/ 
formdata. It may be useful if you are doing a lot of form stuff.

    http://www.faqs.org/rfcs/rfc1867.html

Cheers
Dave



More information about the use-livecode mailing list