how to read All posted variables in ASP ?

liunx

Guest
people It is possible to get the simple variables from text fields in multipart/form-data Form ????

people here is the simple example
<form name="frmMain" method="post" enctype="multipart/form-data">
<input type="file">
<input type="text" name="variable1" value="value1">
<input type="submit" value="submitIt">
</form>

for example i try to get value of the field using this script
<%
response.write(request("variable1"))
%>

thanksusually, when you're trying to use a file input for uploading files and what not, you can't do a request call.

Best thing I've found to do, put a blank <img> on your form and on an onChange on the file input, use some javascript to set the src of the <img> to something like "setValue.asp?var=fileName&val=" + myForm.file.value();

And then setValue.asp would look something like


if request("var") <> "" and request("val") <> "" then
session(request("var")) = request("val")
end if



Usually works well enough - one note: it won't work if the user has their client-side scripting turned off so be sure to try to make it so that some little piece of client-side code is used to submit the form so that you can sorta verify that that Session variable has been set.

The other way to go if you don't like the Session variable approach is really only to go into the target directory on the page right after the upload, find the newest file and assume that was the one just uploaded.
 
Back
Top