Click here to Skip to main content
13,297,547 members (50,637 online)
Rate this:
Please Sign up or sign in to vote.
See more:
hi to all...

I m in a requirement to meet that to download a file from a site. The file is in a folder and file name is in database column. If the user clicks on the name of the File, then that should get download.

Posted 21-Jun-11 4:10am
digital man 21-Jun-11 9:17am
What have you tried already?
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

You can take the help from following link

Click here

Change thehyperlink to your linkbutton and onclick event write the code of downloading.aspx
Marcus Kramer 21-Jun-11 9:45am
Your answer is correct, so I won't give you a 1, but a 2 because this is clearly homework and you are not helping the OP by simply linking him to a complete source code listing. The OP will learn nothing from this and you are in fact just facilitating them in not learning anything.
Brij 21-Jun-11 9:54am
I don't agree with your comments. One cannot force somebody to learn and its just his/her choice to learn.
What you expect the answer? When the Internet flooded with similar kind of question and Answer. Why to write one again. OP should've find it him/herself.
Might be due to some problem, s/he could not find/map the exact answer, So I provided.
If you have sourcecode, you can learn easily if want and if not, nobody can make you to start learn
charles henington 21-Jun-11 10:26am
Brij You get my 5 and Marcus I disagree seeing how a code is structured, written and a visual representation of how a certain outcome was achieved is a great way to learn. All Programmers (Even Yourself) can not say that they have never learned anything from a complete tip/trick or tutorial, which is exactly what you have stated above. When learning programming a visual representation in my opinion is the easiest way to understand and learn from. That being said i think you owe a reconsideration on your vote of 2.
Brij 21-Jun-11 10:31am
Thanks Charles!! You are absolutely correct.
charles henington 21-Jun-11 10:45am
I have a question for you as you seem to be quite the expert in I program in WinForms and I'm currently designing a webBrowser and have googled a great bit on how to get the link of the Element that currently has focus. Do you have any idea how i might be able to go about doing so?
Brij 21-Jun-11 10:50am
You can get it by document.activeElement in your java script code
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

link_button Click event
                Response.BufferOutput = true;
                Response.Buffer = true;
                Response.AddHeader("Content-Disposition", "attachment;filename= " + SELECT FileName.ToString());
                Response.BinaryWrite((byte[])SELECT FILEBODY);

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web02 | 2.8.171207.1 | Last Updated 21 Jun 2011
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100