How to change content type or enctype?

Posted on 2004-11-16
Last Modified: 2008-02-01
I have an upload that takes place in one form; enctype: file-data.  After this upload, a result set is listed on the page w/ an option to remove results.  My "remove" results uses a different form than the upload and also requires a different enctype, normal.  How do I get my remove option to work after I've uploaded an item?
Question by:sl1nger

    Author Comment

    form name="frmMain" enctype="multipart/file-data"
    form name="frmRemove" enctype="application/x-www-form-urlencoded"

    The page is set to multipart after the upload and so, I can't submit values like I normally would for frmRemove...
    LVL 5

    Accepted Solution

    you could check to see if the form has been submitted and then do and it else to display certian content?

    <% If Request.Form("uploader") = "yes" Then %>
    <form name="frmRemove" enctype="application/x-www-form-urlencoded">
    <% Else %>
    <form name="frmMain" enctype="multipart/file-data">
    <input type="hidden" name="uploader" value="yes">
    <% End If %>


    Author Comment

    Is there a way to just change it on the submit?

    Author Comment

    Now, I'm thinking it may be better for one form that changes enctypes depending on the submit button pushed.  Since, I would now I have two different actions.  ok.. so, how would I write one form w/ 2 submit.

    <form name=frmOne enctype=if submitOne then "file-data" else "www">
    <input type=submit name="submitOne" value="upload">
    <input type=submit name="submitTwo" value="remove">

    How would I write this?  Do you think it'll work?

    LVL 5

    Expert Comment

    i would still recomend what i have above???

    Author Comment

    you may be kind of right...  I do know that Request.Form("whatever") will not work becuase of the file-data encytpe.  I may try objFileUp.Form("whatever") = "yes"

    Author Comment

    mk b - also I need to keep the upload form on the same page, so the user can have the option to upload or remove at anytime...

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
    I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
    This video discusses moving either the default database or any database to a new volume.
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now