In my application am using c#.net with out using database. this am doing for intranet ,my query is:
I have created a folder called " backup " in app_data ..in my application,in that folder am uploading files using file-upload..according to the needs..now i want to display those files in data grid with link button or only link button..if i click that link button the file should save in my file system like save as...what are the files in backup folder should be displayed as links...step by step..
any one please help me in this...
just for example..in app_data i have backup folder...in that folder i have 3 files for example...call as a.txt,b.txt.c.txt...these files should display in my page ...the file is not necessary to open ...i just want to show all files in page. if i click any file it should be saved in file system...
for uploading i used this code
Expand|Select|Wrap|Line Numbers
- protected void Btnoffline_Click(object sender, EventArgs e)
- {
- if (Flpload.PostedFile.FileName == "")
- {
- lblstatus.Text = "No file specified.";
- }
- else
- {
- try
- {
- string serverFileName = Path.GetFileName(Flpload.PostedFile.FileName);
- Flpload.PostedFile.SaveAs(MapPath("~/App_Data/backup/") + serverFileName);
- lblstatus.Text = "File " + serverFileName;
- lblstatus.Text += " backup file uploaded successfully.";
- }
- catch (Exception err)
- {
- lblstatus.Text = err.Message;
- }
- }
- }
if u have good any good idea resolving this ..plz share to me...i will develop like that..
thanks
kalyan