• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 234
  • Last Modified:

How to change content type or enctype?

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?
0
sl1nger
Asked:
sl1nger
  • 5
  • 2
1 Solution
 
sl1ngerAuthor Commented:
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...
0
 
mk_bCommented:
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 %>


../mk
0
 
sl1ngerAuthor Commented:
Is there a way to just change it on the submit?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
sl1ngerAuthor Commented:
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?

0
 
mk_bCommented:
i would still recomend what i have above???
0
 
sl1ngerAuthor Commented:
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"
0
 
sl1ngerAuthor Commented:
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...
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

  • 5
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now