Actually I am uploading a file by using file upload control. After successful upload, when I am viewing that page then at that time I want to show that uploaded file on the page which will have the options to download it too. Please help me out on this.
1. Generate dynamic links to files being uploaded and display them in a list or Gridview for example.
HyperLink DynLink = new HyperLink();
DynLink.ID = "DynLink";
DynLink.Text = "This Link Is been Created Dynamically from code behind";
DynLink.NavigateUrl = "~/Images/1.jpeg";
DynLink.Target = "_blank";
PlaceHolder1.Controls.Add(DynLink)
2.Downloading a File with a Save As Dialog in ASP.NET
tripati_tutu
Member
30 Points
53 Posts
How to show uploaded file on the webpage with download option?
Apr 26, 2012 04:23 AM|LINK
Hi All,
Actually I am uploading a file by using file upload control. After successful upload, when I am viewing that page then at that time I want to show that uploaded file on the page which will have the options to download it too. Please help me out on this.
Thanks.
heyitsme
Participant
1085 Points
399 Posts
Re: How to show uploaded file on the webpage with download option?
Apr 26, 2012 04:31 AM|LINK
you can store the image path in database and asssign that path to a hyperlink
<asp:HyperLink ID="linkdld" runat="server" Text="Download" Target="_blank" />
At Code Behind assign
linkdld.navigateurl="Your File path"
Regards
Sangamesh Belawatgi,
Software Developer,
Bangalore - INDIA
nijhawan.sau...
All-Star
16400 Points
3173 Posts
Re: How to show uploaded file on the webpage with download option?
Apr 26, 2012 04:49 AM|LINK
Many options for doing this:
1. Generate dynamic links to files being uploaded and display them in a list or Gridview for example.
HyperLink DynLink = new HyperLink(); DynLink.ID = "DynLink"; DynLink.Text = "This Link Is been Created Dynamically from code behind"; DynLink.NavigateUrl = "~/Images/1.jpeg"; DynLink.Target = "_blank"; PlaceHolder1.Controls.Add(DynLink)2.Downloading a File with a Save As Dialog in ASP.NET
http://www.west-wind.com/weblog/posts/2007/May/21/Downloading-a-File-with-a-Save-As-Dialog-in-ASPNET
3. Or you can diaplay all files in a directory using this:
http://www.4guysfromrolla.com/articles/052803-1.aspx