email form w/ attachments error
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > IIS server support > IIS ASP > email form w/ attachments error




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    email form w/ attachments error  
Gaby


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-17-06 12:19 AM

I made this form with a very basic code

<HTML>
<HEAD>
<TITLE>Submit Papers</TITLE>
</HEAD>
<BODY>
<%
If Len(Request.Form("txtEmail")) > 0 then

Dim objMail
Set objMail = Server.CreateObject("CDONTS.NewMail")

objMail.From = Request.Form("txtEmail")
objMail.Subject = "Email attachment demo"
objMail.AttachFile Server.MapPath(Request.Form("attachment"))
objMail.To = "mymail@school.edu"
objMail.Body = "the following papers have been submitted."
objMail.Send

Response.write("<i>EMail was Sent</i><p>")

'You should always do this with CDONTS.
set objMail = nothing


End If
%>

<form method="post" id=form1 name=form1>
<b>Enter your email address:</b><br>
<input type="text" name="txtEmail"
value="<%=Request.Form("txtEmail")%>">

<input type=file name="attachment" runat=server
value="<%Request.Form("attachment")%>">
<p>
<input type="submit" value="Submit!" id=submit1 name=submit1>
</form>

</BODY>
</HTML>


---

i tried it and got this error:

Server.MapPath() error 'ASP 0172 : 80004005'

Invalid Path

/web/test/email/demo2.asp, line 14

The Path parameter for the MapPath method must be a virtual path. A
physical path was used.


---
is there something i should change to make sure i get what they
selected as an atachment.

thanks again,
gabriel






[ Post a follow-up to this message ]



    Re: email form w/ attachments error  
Ron Hinds


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-17-06 12:19 AM

"Gaby" <GabrielESandoval@gmail.com> wrote in message
news:1150492278.725596.187030@r2g2000cwb.googlegroups.com...
> I made this form with a very basic code
>
> <HTML>
> <HEAD>
> <TITLE>Submit Papers</TITLE>
> </HEAD>
> <BODY>
> <%
> If Len(Request.Form("txtEmail")) > 0 then
>
> Dim objMail
> Set objMail = Server.CreateObject("CDONTS.NewMail")
>
> objMail.From = Request.Form("txtEmail")
> objMail.Subject = "Email attachment demo"
> objMail.AttachFile Server.MapPath(Request.Form("attachment"))
> objMail.To = "mymail@school.edu"
> objMail.Body = "the following papers have been submitted."
> objMail.Send
>
> Response.write("<i>EMail was Sent</i><p>")
>
> 'You should always do this with CDONTS.
> set objMail = nothing
>
>
> End If
> %>
>
>   <form method="post" id=form1 name=form1>
>     <b>Enter your email address:</b><br>
>     <input type="text" name="txtEmail"
> value="<%=Request.Form("txtEmail")%>">
>
>     <input type=file name="attachment" runat=server
> value="<%Request.Form("attachment")%>">
>     <p>
>     <input type="submit" value="Submit!" id=submit1 name=submit1>
>   </form>
>
> </BODY>
> </HTML>
>
>
> ---
>
> i tried it and got this error:
>
> Server.MapPath() error 'ASP 0172 : 80004005'
>
> Invalid Path
>
> /web/test/email/demo2.asp, line 14
>
> The Path parameter for the MapPath method must be a virtual path. A
> physical path was used.
>
>
> ---
> is there something i should change to make sure i get what they
> selected as an atachment.
>
> thanks again,
> gabriel

The INPUT type=file gives a browse button for the Client to search for files
located on *their* machine. Server.MapPath, on the other hand, is used to
map a virtual path (e.g. /uploads/filename.ext) to a physical path *on the
server*, NOT on the client! What you need is a way to upload the client's
file to your webserver, in, for instance, an "uploads" virtual folder on
your webserver. Although there is a "Posting Acceptor" ASP sample script
from Microsoft, I've never seen it work. You need a third-party file
uploader like SoftArtisans SAFileUp - http://www.softartisans.com.








[ Post a follow-up to this message ]



    Re: email form w/ attachments error  
Gaby


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-17-06 12:19 AM

that stinks.  i was under the impression i could get it to work without
a third-party fileuploader.
i guess ill try something completely different.

thanks.
gabriel

Ron Hinds> The INPUT type=file gives a browse button for the Client to
search for files
> located on *their* machine. Server.MapPath, on the other hand, is used to
> map a virtual path (e.g. /uploads/filename.ext) to a physical path *on the
> server*, NOT on the client! What you need is a way to upload the client's
> file to your webserver, in, for instance, an "uploads" virtual folder on
> your webserver. Although there is a "Posting Acceptor" ASP sample script
> from Microsoft, I've never seen it work. You need a third-party file
> uploader like SoftArtisans SAFileUp - http://www.softartisans.com.






[ Post a follow-up to this message ]



    Re: email form w/ attachments error  
Stefan Berglund


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-17-06 06:24 AM

On 16 Jun 2006 15:29:59 -0700, "Gaby" <GabrielESandoval@gmail.com>
wrote:
in <1150496999.015829.188720@g10g2000cwb.googlegroups.com>
[vbcol=seagreen]
>that stinks.  i was under the impression i could get it to work without
>a third-party fileuploader.
>i guess ill try something completely different.
>
>thanks.
>gabriel
>
>Ron Hinds> The INPUT type=file gives a browse button for the Client to
>search for files 

If you have an app installed on their computer you can use the FTP API
to upload files.

---
Stefan Berglund





[ Post a follow-up to this message ]



    Re: email form w/ attachments error  
MikeR


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-17-06 06:28 PM

Gaby wrote:
> that stinks.  i was under the impression i could get it to work without
> a third-party fileuploader.
> i guess ill try something completely different.
My ISP provides an upload component. Check with yours.
Mike





[ Post a follow-up to this message ]



    Re: email form w/ attachments error  
surf_doggie


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-18-06 06:19 PM

Actually you can do a pure asp upload without a 3rd party component &
without using the MS object Mike mentions.

Hang on let me see if I cant track it down... Hummm this is not the one
Im thinking of but didnt even know this was out there
http://www.asp101.com/articles/jacob/scriptupload.asp

Here you go http://www.freevbcode.com/ShowCode.asp?ID=5340

Earl






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 12:46 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register