...

View Full Version : Help With File Field.



Baleric
12-26-2006, 08:15 AM
Hey guys, was wondering if it is possible to read the entire content of a file field,

eg.

the file field has in it "C:\Documents and Settings\administrator\Desktop\Untitled-1.jpg"

but after submitted, request.form only returns "Untitled-1.jpg"

i need the entire path form the file field, im trying to make an email system that sends emails with attachments. and the file field is the attachment that will be sent.

can someone please help, cheers.

baleric.


this is my code.
<%
if request.querystring("id") = 21 then
Dim ObjSendMail
Dim iConf
Dim Flds
Set ObjSendMail = Server.CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
Set Flds = iConf.Fields
Flds("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1
Flds("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory") = "c:\inetpub\mailroot\pickup"
Flds.Update


Set ObjSendMail.Configuration = iConf
ObjSendMail.To = "testing@testing.com"
ObjSendMail.Subject = "testing@testing.com"
ObjSendMail.From = "testing@testing.com"
ObjSendMail.htmlBody = "this is the body"
ObjSendMail.AddAttachment request.Form("file1")
ObjSendMail.Send

Set ObjSendMail = Nothing
response.Redirect("default.asp")
else
end if
%>

njzy
12-26-2006, 09:55 AM
I am afraid you have to upload this file to server first if you want send it as attachment.

Baleric
01-02-2007, 12:31 AM
I am afraid you have to upload this file to server first if you want send it as attachment.

thanks, i got it working, the file upoloads then send to gmail then deletes it so the server doesnt get full :)

cheers



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum