Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > <INPUT type="file" runat="server" - attach to email

Reply
Thread Tools

<INPUT type="file" runat="server" - attach to email

 
 
=?Utf-8?B?U2liQW5kZWxh?=
Guest
Posts: n/a
 
      07-31-2004
Is there a way that I can attach the uploaded file from a client web site to the web server without first storing the uploaded file on the server?

Currently on my local PC (local host) the following code works but not when I run the app from a web server it fails:

private void StoreFile(HttpPostedFile uploadedFile)
{
FileInfo uploadedFileInfo = new FileInfo(uploadedFile.FileName);
......
uploadedFileInfo.CopyTo(fileName, true); // fails on server but not on local host
}
and then later
public void SendEmail(string sendTo, string fileName, string subject, string eMessage)
{
......
MailAttachment ma = new MailAttachment(fileName,MailEncoding.Base64);
}

The upload fails every time
 
Reply With Quote
 
 
 
 
Lau Lei Cheong
Guest
Posts: n/a
 
      08-02-2004
I think you have to enable "write" right for ASPNET(or other impersonation
account you used) account on the server first for HtmlInputFile.CopyTo() to
work.

"SibAndela" <(E-Mail Removed)> bl
news:(E-Mail Removed) g...
> Is there a way that I can attach the uploaded file from a client web site

to the web server without first storing the uploaded file on the server?
>
> Currently on my local PC (local host) the following code works but not

when I run the app from a web server it fails:
>
> private void StoreFile(HttpPostedFile uploadedFile)
> {
> FileInfo uploadedFileInfo = new FileInfo(uploadedFile.FileName);
> .....
> uploadedFileInfo.CopyTo(fileName, true); // fails on server but not on

local host
> }
> and then later
> public void SendEmail(string sendTo, string fileName, string subject,

string eMessage)
> {
> .....
> MailAttachment ma = new MailAttachment(fileName,MailEncoding.Base64);
> }
>
> The upload fails every time



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there any shortcut for "Debug > Attach > Attach to aspnet_wp.exe"? Warren Tang ASP .Net 1 09-17-2008 03:46 PM
attach agent to applet running in firefox (attach api) craiget@gmail.com Java 0 06-14-2007 12:28 AM
Can't attach files to email waverlyrose Software 1 06-26-2006 01:45 PM
attach flag to email msg from asp.net page =?Utf-8?B?RGVyZWsgTQ==?= ASP .Net 1 10-27-2004 02:25 PM
locating file extensions to attach to email Jan Computer Support 3 11-18-2003 06:27 AM



Advertisments