473,748 Members | 10,771 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

CDO.MESSAGE ATTACHMENT

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.AddA ttachment Request.Form("u ploadfile")

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.

May 19 '07 #1
7 13612
rn**@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.AddA ttachment Request.Form("u ploadfile")
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.
May 19 '07 #2
On May 19, 8:17 pm, "Dave Anderson" <NPQRWPDWZ...@s pammotel.com>
wrote:
r...@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.AddA ttachment Request.Form("u ploadfile")

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.
But, Dave, how do I write the file to the hard disk of the server in
the first place?

May 19 '07 #3
rn**@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.
May 20 '07 #4
On May 20, 9:44 am, "Dave Anderson" <NPQRWPDWZ...@s pammotel.com>
wrote:
r...@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.
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\MyF ile.doc from my local machine, then it will be
stored in the database as C:\MyFolder\MyF ile.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.

May 20 '07 #5
<rn**@rediffmai l.comwrote:
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.
May 20 '07 #6
On May 20, 10:55 am, "Dave Anderson" <NPQRWPDWZ...@s pammotel.com>
wrote:
<r...@rediffmai l.comwrote:
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.
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

May 20 '07 #7
rn**@rediffmail .com wrote:
>...I store the file and its content-type, filename, etc. in a
database...

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.CreateOb ject("Fath.Uplo ad"),
CN = Server.CreateOb ject("ADODB.Con nection"),
CMD = Server.CreateOb ject("ADODB.Com mand")

CN.Open(myConne ctionString)
CMD.ActiveConne ction = CN
CMD.CommandType = adCmdStoredProc

UP.Receive("")

CMD.CommandText = "myStoredProced ureName"
CMD.Parameters. Append(CMD.Crea teParameter("@G UID",adGUID,adP aramInput,16))
CMD.Parameters. Append(CMD.Crea teParameter("@I mage",adVarBina ry,adParamInput ,16))
CMD.Parameters. Append(CMD.Crea teParameter("@C ontentType",adV arChar,adParamI nput,50))
CMD.Parameters( "@GUID").Va lue = UP.Field("AdGUI D").Value
CMD.Parameters( "@Image").S ize = UP.File("AdImag e").Size
CMD.Parameters( "@Image").V alue = UP.File("AdImag e").GetChunk(0, Size)
CMD.Parameters( "@ContentType") .Value = UP.File("AdImag e").ContentT ype
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.
May 21 '07 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1335
by: David | last post by:
I have a C# application that functions as follows: 1. Log onto a pop3 mail account 2. search for any messages from a given source. 3. Get the attachment from the message. (This attachment will ALWAYS be a TIFF file). 4. store new tiff file on local server. I have everything working except the file I save cannot be viewed. I'm sure its because of the formating of the string I store in the
0
1123
by: Aquila Deus | last post by:
Hi all! I found an interesting way to implement strong-typed object attactment with generic: // Attachment should be a Dictionary<K,V> or some user-defined container, rather // than primitive types such as string, int or DateTime. class AttachableObject<AttachmentType> where AttachmentType: new() {
2
12186
by: Robbie De Sutter | last post by:
Hello, How do I open a new, empty e-mail message from the default e-mail client whereby the sender is given and a file is attached? Currently I use the command (vb.net): --- System.Diagnostics.Process.Start("mailto:someone@somewhere&subject=the% 20subject") ---
8
1530
by: Howard | last post by:
Using visual studio 2005 I am sending an email using a vaiable Dim mail As New MailMessage() and then later setting the recipient address by mail.To = name@domain.co.uk This works fine. However the compiler tells me that New MailMessage() is now obsolete and that instead I should use
5
2367
by: Robert Dufour | last post by:
I am trying to use framework 1.1 - stuck with it. to send emails from a windows form application. The email messages can have attachments, usually two and they can be either text or sounds (wav files) or images (bmp, gif or tiff) I can send the email messages OK but the attachments are giving me grief. Can anyone provide some code that adds attachments to web mail messages. Thanks for any help,
6
1973
by: Karl Groves | last post by:
I'm trying to work out a mail system which can send an attachment as well as an HTML formatted message (and a default plain text version). I found some pretty good code on PHP.net and modified it a little but I can't seem to get it to work. It attaches the file properly, but only displays the Plain Text message, even in an HTML-capable mail client. I'm guessing it has something to do with the placement of the boundaries,
11
1867
by: Marc Castrechini | last post by:
The business requirement is relatively simple: Automatically open a new mail message using the default mail client (Outlook 2003) and attach a document located on the server. Obviously we need to open the New Mail Message on the client so we are trying to determine if this is possible by setting the content type and streaming the content to the browser. TIA, - Marc Castrechini
0
1287
by: mmatchyn | last post by:
How do I attach an outlook email message as an attachment within another outlook email message. Right now I am using the following code. But I was wondering if there is a better way to do this without using a file that needs to be deleted later. private MailMessage addAttachment(MailMessage Mail, MailItem item) { string path "Messages\\message" + message_id+ ".MSG";
3
3837
by: Steven Allport | last post by:
I am working on processing eml email message using the email module (python 2.5), on files exported from an Outlook PST file, to extract the composite parts of the email. In most instances this works fine, the message is read in using message_from_file, is_multipart returns True and I can process each component and extract message attachments. I am however running into problem with email messages that contain emails forwarded as...
0
8989
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
9319
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8241
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6795
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6073
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4599
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4869
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2780
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2213
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.