Click here to Skip to main content
16,005,682 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
C#
{
SqlConnection con = new SqlConnection();
    SqlCommand cmd = new SqlCommand();
    private SqlDbType sq;


    protected void Page_Load(object sender, EventArgs e)
    {


        if ("progimg "== "cmd")
        {
            string filename = " progimg".ToString();
            if (filename != "")
            {
                string path = MapPath(filename);
                byte[] bts = System.IO.File.ReadAllBytes(path);
                Response.Clear();
                Response.ClearHeaders();
                Response.AddHeader("Content-Type", "Application/octet-stream");
                Response.AddHeader("Content-Length", bts.Length.ToString());

                Response.AddHeader("Content-Disposition", "attachment;   filename=" + filename);

                Response.BinaryWrite(bts);

                Response.Flush();

                Response.End();
            }
        }



[edit]Code block added[/edit]
Posted
Updated 6-Jun-13 10:22am
v2
Comments
Artefakt94 6-Jun-13 9:08am    
Hello,
What is the question ? Rewrite your post please ;)
Mac12334 6-Jun-13 9:08am    
what is your problem??
Can you please explain your problem briefly.

1 solution

can you tell me what exactly you want to do??
 
Share this answer
 
Comments
Richard C Bishop 6-Jun-13 18:05pm    
Why did you ask a question as a solution to this question? See any problems with that logic?

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