Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

CGI and multipart/form-data

by artist (Parson)
on Aug 29, 2006 at 15:52 UTC ( [id://570197]=perlquestion: print w/replies, xml ) Need Help??

artist has asked for the wisdom of the Perl Monks concerning the following question:

CGI version 3.15 uses enctype="multipart/form-data" in start_form() method. That is not always easy for accepting process to decode. How I can remove the enctype from start_form()?
--Artist

Replies are listed 'Best First'.
Re: CGI and multipart/form-data
by davido (Cardinal) on Aug 29, 2006 at 16:07 UTC

    Do you really need to remove it, or could you just specify a different value?

    The POD for CGI tells how to specify a different value, here: Starting and Ending a Form


    Dave

Re: CGI and multipart/form-data
by jeffa (Bishop) on Aug 29, 2006 at 19:29 UTC

    This suggestion, of course, does not answer your question ... but maybe now would be a good time to consider switching to a templating solution:

    I rarely (if ever) use CGI.pm to produce HTML anymore -- templating simply offers more control.

    jeffa

    L-LL-L--L-LL-L--L-LL-L--
    -R--R-RR-R--R-RR-R--R-RR
    B--B--B--B--B--B--B--B--
    H---H---H---H---H---H---
    (the triplet paradiddle with high-hat)
    
      I agree, well, mostly!

      The only time I don't use pure templating is creating things like drop-down lists and radio-button groups where I use CGI to generate a simple fragment which I then put into an HTML::Template based template.

      jdtoronto

        Indeed, using CGI.pm for such is indeed <UPDATE> very nice. It also handles the problems associated with having a user submit invalid data and having to fill in the values they submitting correctly. </UPDATE> But these days i just make Mason components and use HTML::FillInForm to handle the 'stickiness' issue like so:

        <&| /lib/util/fill_in_form.mas, data => \%ARGS &> <form> <!-- select, text inputs, radio boxes, etc. go here --> </form> </&>
        And the fill_in_form.mas component instantiates the HTML::FillInForm object and ... MAGIC! =D

        jeffa

        L-LL-L--L-LL-L--L-LL-L--
        -R--R-RR-R--R-RR-R--R-RR
        B--B--B--B--B--B--B--B--
        H---H---H---H---H---H---
        (the triplet paradiddle with high-hat)
        
Re: CGI and multipart/form-data
by Khen1950fx (Canon) on Aug 29, 2006 at 23:56 UTC
    There's a cool little program that I've been playing with. It serves as a test harness for HTTP and CGI, and it's an intermediary between the cmd and putting the form online. It's called cgeye. You could experiment with removing enctype offline before it goes to the server.

    cgeye

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://570197]
Approved by marto
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2024-04-18 01:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found