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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP File Upload Error

Status
Not open for further replies.

feemi

Programmer
Feb 3, 2001
17
US
I'm trying to use the ASP Upload code to upload a file to the server. In addition, I'm allowing the user to enter information that will be included in an email. If I use the ASPUpload logic (uses a binary read) then I cannot use the request.form object to get my email information. I can get around this by using querystring. However, because the page renders before the user enters the information, my querystring values are null. I thought I could self post and if there is an email, the set all the email values and create another form posting to the submit page that will upload the file and send the email. This new form could pass the values using a querystring obtained from the first firm. Unfortunately, when I automatically submit this form the ASPUpload doesn't read the file that is being uploaded. If I view source, I can see that the Value for File1 is correctly set, but it just isn't getting a file count. Any idea on how I can submit this form automatically and get the ASPUpload to recognize that a file is being submitted?

<form method=&quot;post&quot; ENCTYPE=&quot;multipart/form-data&quot; action=&quot;emailsubmit.asp?user=<%=user%>&from=<%=from%>&subject=<%=subject%>&sendto=<%=sendto%>&message=<%=message%>&dateofmessage=<%=dateofmessage%>&quot; name=&quot;emailsubmitform&quot;>
<table>
<TR>
<TD><INPUT TYPE=FILE SIZE=50 NAME=&quot;File1&quot; value=&quot;<%=request(&quot;File1&quot;)%>&quot;></td>
</TR>
</table>
</form>
<script language=javascript>
document.all.emailsubmitform.submit();
</script>
 
asp upload gives you access to all of your normal form elements via the &quot;upload&quot; object:

Before:

thisVal = request.form(&quot;thisVal&quot;)

Now:

thisVal = upload.form(&quot;thisVal&quot;) -----------------------------------------------------------------
&quot;The difference between 'involvement' and 'commitment' is like an eggs-and-ham breakfast: the chicken was 'involved' - the pig was 'committed'.&quot;
- unknown

mikewolf@tst-us.com
 
You must be joking. Is it that simple? I'll give it a try.

Thanks
 
I'm getting

Microsoft VBScript runtime error '800a01f4'

Variable is undefined: 'Upload'
 
Ok, I have it now. Thanks for your help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top