ASP Forum
Please Help...its urgent
new_learner | Posted 0:41am 27. February 2009 Server Time |

Hii, i am once again posting...

Need your quick help with the below:

This is what i am doing..
I am requesting the user to attach a file from his local PC(client), and then i am uploading the file to the server. Then using a form, when a user clicks send button, it should attach the file from the server and send it via email, also the file should be deleted after its been sent.

How should i accomplish this task...
The uploading part is working...just need to know how to pick the file from the server and attach it and send it via email and finally delete the file...this is quite urgent..pls help me..i am desperatly looking out for a solution..

looking forward
eric1973 | Posted 3:53pm 2. March 2009 Server Time |

When you upload the file to the server you already know the file name and the directory it's in.

So you can probably use Server.MapPath to the file in the email script then after the email has been sent use something like:

Set fso = CreateObject("Scripting.FileSystemObject")
  IF fso.FileExists(Server.MapPath("/directory/" & FileName) Then
    Set fileObject = fso.GetFile(Server.MapPath("/directory/" & FileName)
    fileObject.Delete
  End If
Set fileObject = Nothing
Set fso = Nothing


Reply to Post Please Help...its urgent



Back to Forum Page