954,577 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

View a file that stored on the folder

Hi,

I stored a file in the folder taht selected using file upload control.

When I tried to view this content from that folder I got an error like this.

Cannot find the C:\Documents and settings\Terapc\LocalSettings\temporary Internet Files\Content.IE5\6AJ9DNHZ\name.txt file

Do you want to create a new file?

The code I used to view this file is:

if (file.Exists) 
{

Response.Clear();

Response.AddHeader("Content-Disposition", "attachment; filename=" + file.Name); 
Response.AddHeader("Content-Length", file.Length.ToString());

Response.ContentType = "application/octet-stream"; 
Response.WriteFile(file.FullName);

Response.End();

}

else

{

MsgBox1.alert("The file does not exist"); 
}


Hope you can help me.

Thanks in advance.

ssreevidya.m
Junior Poster in Training
51 posts since Jan 2009
Reputation Points: 10
Solved Threads: 0
 

Is that the correct path to where the file is being saved to?

nhauck
Newbie Poster
7 posts since Jan 2009
Reputation Points: 10
Solved Threads: 1
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You