Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing Form Parameters

Status
Not open for further replies.

fischadler

Programmer
May 31, 2002
258
MT
Take a look at the form below:

<FORM ACTION="upload_news_pic.asp" METHOD=POST enctype="multipart/form-data" id="form2" name="form2">
<INPUT name="file1" type="file" size="60">
<BR>
<input type="text" name="txtCaption" size="20"><br>
<br>
<input type="submit" value="Upload" name="B3">
</FORM>

The parameters inside the "text" type input named "txtCaption" is not passed to "upload_news_pic.asp". The problem seems to be with 'enctype="multipart/form-data"'. When I remove that, the parameter is passed. But then the uploading function does not work. I am using this form for uploading pictures.

Is there a way around this?
 
yes, what upload code are u using??? it will have its own method...

Known is handfull, Unknown is worldfull
 
When you have file uploading, for some reason you won't be able to use request.form. There is a way around it though. I think you can use upl.form instead of request.form to pass any parameters. That uses Server.CreateObject("Persits.Upload.1"). So you'd have to make sure your server has that or else you can install it.
 
Jeremy,
Looks like your solution requires a particular DLL. What exactly is it's name?
Unfortunately, I don't own the server on which I put my pages and the owners are very reluctant to install third party dll's for me.
 
There should already be a component or script that is handling your uploads for you. Pretty much every one of these has spome method for accessing the form collection. The problem is that once you use a BinaryRead to read some of the posted form data (BinaryRead is necessary to read the file data) you can no longer access the Form collection. Luckily most of the components have an internal collection similar to the Request.Form collection to hold any other field data you mighthave, so (as I said) there should be a builtin method already.

-T

barcode_1.gif
 
Unfortunately I am not using any component. The upload page uses File Access features of ASP to save the data to file. I got the code from Planet Source code and it's too long to post on this forum. But if you need to take a look at it I can do that. I have added some code to it to save some data to a database too. One parameter was passed as a session variable (instead of a hidden input). But I can't transfer the contents of a "Text" input.
 
does it have a loader.asp by chance???

Known is handfull, Unknown is worldfull
 
I don't know what that is, but there's no reference to it in my code.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top