1) In your website like http://www.asp.net, create one temp virtual directory that will be like http://www.asp.net/temp
In your virtual dicrectory point to your server folder where your dicrectory resides.
Now from URL you can easily access the server document like http:asp.net/temp/newworddocument.docx
Now you can assign this document URL to your link button with target=_blank will open new browser or tab with save or open option.
2) scond way , here you can read binary of file and can write in in response(response.write) in your c#\vb.net code will also open the save and open dialoage
sameer.khanjit@gmail.com
View Blog Click "Mark as Answer" on the post that helped you.
Marked as answer by Sage Gu - MSFT on Sep 07, 2012 01:53 AM
nikitha
Member
8 Points
79 Posts
Download a file using link button
Aug 31, 2012 09:45 AM|LINK
HI,
I want to down load a word document by clicking a link in c# .I need to keep back ground image for tat link.
which is the best way to do?please help.
(download means open,save as file)
urenjoy
Star
12347 Points
1857 Posts
Re: Download a file using link button
Aug 31, 2012 09:56 AM|LINK
Check following:
http://www.c-sharpcorner.com/UploadFile/Globalking/filedownload02272006052052AM/filedownload.aspx
OR
Another way is to just have a hyperlink to the file and with the client click on the file the browser will ask them if they want to download.
you can have them right click and do a save target to download.
pradeep shar...
Contributor
3988 Points
760 Posts
Re: Download a file using link button
Aug 31, 2012 10:24 AM|LINK
http://techtt.org/?tag=/File-Download
sameer_khanj...
Contributor
7060 Points
1378 Posts
Re: Download a file using link button
Aug 31, 2012 12:41 PM|LINK
1) In your website like http://www.asp.net, create one temp virtual directory that will be like http://www.asp.net/temp
In your virtual dicrectory point to your server folder where your dicrectory resides.
Now from URL you can easily access the server document like http:asp.net/temp/newworddocument.docx
Now you can assign this document URL to your link button with target=_blank will open new browser or tab with save or open option.
2) scond way , here you can read binary of file and can write in in response(response.write) in your c#\vb.net code will also open the save and open dialoage
sameer.khanjit@gmail.com
View Blog
Click "Mark as Answer" on the post that helped you.