Click here to Skip to main content
15,868,164 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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.

thanks..
Posted
Comments
R. Giskard Reventlov 21-Jun-11 9:17am    
What have you tried already?

You can take the help from following link

Click here

Change thehyperlink to your linkbutton and onclick event write the code of downloading.aspx
 
Share this answer
 
Comments
fjdiewornncalwe 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 asp.net. 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?
link_button Click event
            {
                Response.BufferOutput = true;
                Response.Buffer = true;
                Response.AddHeader("Content-Disposition", "attachment;filename= " + SELECT FileName.ToString());
                Response.BinaryWrite((byte[])SELECT FILEBODY);
                Response.Flush();
                Response.End();
            }
 
Share this answer
 
v2

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900