 |
|
 |
|
05-19-07 06:19 PM
When a user posts a HTML Form in an ASP page, the values entered by
the user in the Form are mailed to the website owner. Users can also
attach a file before posting the Form.
To send the e-mail, I am using CDO.MESSAGE. When I tested the app in
my local intranet IIS5.1 server, the e-mail part worked fine & even
the attachment was sent along with the mail but after deploying the
site at godaddy.com, when I try to send a file from my local hard disk
as an attachment, I get the following error:
===================================
CDO.Message.1 error '80070003'
The system cannot find the path specified.
====================================
which points to the line that does the attachment which is
cdoMessage.AddAttachment Request.Form("uploadfile")
It's pretty obvious what's causing the error - the ASP file resides
onthe server whereas the file to be attached exists in the users local
hard drive but the question is how do I resolve this error?
Please note that users will attach files from their local hard disks.
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
 |
Re: CDO.MESSAGE ATTACHMENT |
 |
 |
|
|
05-19-07 06:19 PM
rn5a@rediffmail.com wrote:
> To send the e-mail, I am using CDO.MESSAGE. When I tested the app in
> my local intranet IIS5.1 server, the e-mail part worked fine & even
> the attachment was sent along with the mail but after deploying the
> site at godaddy.com, when I try to send a file from my local hard disk
> as an attachment, I get the following error:
>
> ===================================
> CDO.Message.1 error '80070003'
>
> The system cannot find the path specified.
> ====================================
When you attach a file with CDO.Message, you must provide a URL to that file
that the server can access. This is often on the server itself.
In effect, you must have the user UPLOAD the file to be attached, write it
to disk (or database), then provide a URL to either a script that will
retrieve that file[1], or a path to the file.
>
> which points to the line that does the attachment which is
>
> cdoMessage.AddAttachment Request.Form("uploadfile")
RTM: http://msdn2.microsoft.com/en-us/library/ms526983.aspx
[1] While it may be tempting to link directly to the file if written to
the
server, IIS6 will not serve it up via http unless specifically configured
for that file's extension.
--
Dave Anderson
Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
 |
Re: CDO.MESSAGE ATTACHMENT |
 |
 |
|
|
05-20-07 12:16 AM
On May 19, 8:17 pm, "Dave Anderson" <NPQRWPDWZ...@spammotel.com>
wrote:
> r...@rediffmail.com wrote:
>
>
>
> When you attach a file with CDO.Message, you must provide a URL to that fi
le
> that the server can access. This is often on the server itself.
>
> In effect, you must have the user UPLOAD the file to be attached, write it
> to disk (or database), then provide a URL to either a script that will
> retrieve that file[1], or a path to the file.
>
>
>
>
>
> RTM:http://msdn2.microsoft.com/en-us/library/ms526983.aspx
>
> [1] While it may be tempting to link directly to the file if written t
o the
> server, IIS6 will not serve it up via http unless specifically configured
> for that file's extension.
>
> --
> Dave Anderson
>
> Unsolicited commercial email will be read at a cost of $500 per message. U
se
> of this email address implies consent to these terms.
But, Dave, how do I write the file to the hard disk of the server in
the first place?
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
 |
Re: CDO.MESSAGE ATTACHMENT |
 |
 |
|
|
05-20-07 06:20 AM
rn5a@rediffmail.com wrote:
> But, Dave, how do I write the file to the hard disk of the
> server in the first place?
Beats me. I stick 'em in a database. You could start here, though:
http://www.aspfaq.com/show.asp?id=2189
--
Dave Anderson
Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
 |
Re: CDO.MESSAGE ATTACHMENT |
 |
 |
|
|
05-20-07 06:20 AM
On May 20, 9:44 am, "Dave Anderson" <NPQRWPDWZ...@spammotel.com>
wrote:
> r...@rediffmail.com wrote:
>
> Beats me. I stick 'em in a database. You could start here, though:http://www.asp
faq.com/show.asp?id=2189
>
> --
> Dave Anderson
>
> Unsolicited commercial email will be read at a cost of $500 per message. U
se
> of this email address implies consent to these terms.
Dave, by "stick 'em in a database", do you mean populating the
physical path (of the local hard disk of the user) of the file to be
attached? I have already tried that after going through your first
reply but the error persists for obvious reasons. If I upload a file
from C:\MyFolder\MyFile.doc from my local machine, then it will be
stored in the database as C:\MyFolder\MyFile.doc but there's no file
named MyFile.doc within any directory named MyFolder in the C:\ drive
of the server; so how will the server upload the file?
Pardon me if I have misinterpreted your database suggestion.
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
 |
Re: CDO.MESSAGE ATTACHMENT |
 |
 |
|
|
05-20-07 06:20 AM
<rn5a@rediffmail.com> wrote:
> Dave, by "stick 'em in a database", do you mean populating the
> physical path (of the local hard disk of the user) of the file
> to be attached?
No. I mean I store the file and its content-type, filename, etc. in a
database. I have done it with SQL Server 2000 and 2005. The SQL Server data
type for storing arbitrary binary data (which you will need for files) is
"Image".
--
Dave Anderson
Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
 |
Re: CDO.MESSAGE ATTACHMENT |
 |
 |
|
|
05-20-07 12:19 PM
On May 20, 10:55 am, "Dave Anderson" <NPQRWPDWZ...@spammotel.com>
wrote:
> <r...@rediffmail.com> wrote:
>
> No. I mean I store the file and its content-type, filename, etc. in a
> database. I have done it with SQL Server 2000 and 2005. The SQL Server dat
a
> type for storing arbitrary binary data (which you will need for files) is
> "Image".
>
> --
> Dave Anderson
>
> Unsolicited commercial email will be read at a cost of $500 per message. U
se
> of this email address implies consent to these terms.
Ooops....I completely got it wrong! Sorry......
Dave, could you please link me to some articles on how did you do that
or show a small code snippet?
Thanks,
Regards,
Arpan
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
 |
Re: CDO.MESSAGE ATTACHMENT |
 |
 |
|
|
05-22-07 12:26 AM
rn5a@rediffmail.com wrote:
>
> Dave, could you please link me to some articles on how did you
> do that or show a small code snippet?
In classic ASP, we do everything in JScript, and there is no simple or
efficient pure ASP/JScript way of doing it, so in the past, we used a
component. In our case, we bought a copy of Fath Upload
(http://www.fathsoft.com/upload.html) for the simple reason that it allowed
us access to the data stream -- and thus made direct database inserts
straightforward. A simplified example, from a script with which we attach an
image to a classified ad:
var UP = Server.CreateObject("Fath.Upload"),
CN = Server.CreateObject("ADODB.Connection"),
CMD = Server.CreateObject("ADODB.Command")
CN.Open(myConnectionString)
CMD.ActiveConnection = CN
CMD.CommandType = adCmdStoredProc
UP.Receive("")
CMD.CommandText = "myStoredProcedureName"
CMD.Parameters.Append(CMD.CreateParameter("@GUID",adGUID,adParamInput,16))
CMD.Parameters.Append(CMD.CreateParameter("@Image",adVarBinary,adParamInput,
16))
CMD.Parameters.Append(CMD.CreateParameter("@ContentType",adVarChar,adParamIn
put,50))
CMD.Parameters("@GUID").Value = UP.Field("AdGUID").Value
CMD.Parameters("@Image").Size = UP.File("AdImage").Size
CMD.Parameters("@Image").Value = UP.File("AdImage").GetChunk(0,Size)
CMD.Parameters("@ContentType").Value = UP.File("AdImage").ContentType
CMD.Execute()
It has become ridiculously easy -- not to mention free and likely to be
around in the future -- with ASP.NET 2.0, so we have moved away from doing
uploads with classic ASP.
--
Dave Anderson
Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
|
Sponsored Links |
 |
 |
|
|
 |
All times are GMT. The time now is 04:21 AM. |
 |
|
|
 |
|
 |
|
|
 |
|
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
|
 |
|
 |
|