Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_vb_dotnet thread: XML and File Upload in ASP.NET


Message #1 by "Rob Taylor - TConsult, Inc." <rob@t...> on Sun, 3 Mar 2002 19:59:33 -0500
Ok we have a voice application that works like this. You call, answer the 
questions, and hang up.  A wav file is created of your answers and saved.  
Simple enough.  At least with classic ASP.  Now we want to do it in .NET.  
Problem is I cannot access the file.  I want to send an email when the
phone hangs up and save the .wav file.  I can get the email to send but
as soon as I put the upload code in there it won't work.  I have posted 
the code below. So what I need to know is how in the heck do  I get this 
file to upload with .NET?  Currently I get  an error that says "The name  
file is not  declared".  Thanks in advance.

Rob


- <form>
- <record name="file" beep="true" maxtime="10s" finalsilence="4000ms" 
type="audio/wav" modal="true" dtmfterm="true">
  <prompt>At the beep, please record a message.</prompt> 
- <filled mode="all">
  <submit next="welcome.aspx?mssg=YES" method="post" 
enctype="multipart/form-data" namelist="file" /> 
  </filled>
  </record>
  </form>

<%
	If request.querystring("mssg") <> "" then
		Dim filename as string
		filename = file.postedfile.filename
		file.postedFile.SaveAs (Server.MapPath("myfiles") & "/" & 
filename)
		Dim smtpMssg AS new MailMessage 
		smtpMssg.From = "rob@t..." 
		smtpMssg.To = "rob@t..."
		smtpMssg.Subject = "WAV" 
		smtpMssg.Body = "New WAV file has been posted " & filename
		SmtpMail.Send(smtpMssg) 
	End If
%>

  Return to Index