G
Guest
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
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