3

hi i m uploading a file and for that i have implemented aspx and .cs pages.but now i want to add progress bar only.how to do that?

protected void btnUpload_Click(object sender, EventArgs e)
{
    HttpPostedFile postedFile = FileUpload1.PostedFile;
    string ClientFileName, ServerFileName;

    if ((FileUpload1.HasFile && FileUpload1.PostedFile != null) || txtUrl.Text!="")
    {
        lblOutput.Text = "";

            HttpPostedFile myFile = FileUpload1.PostedFile;


                    ServerFileName = System.IO.Path.Combine(ServerSavePathI, ClientFileName);


                    string serverPath = Server.MapPath(ServerFileName);

                    FileUpload1.SaveAs(serverPath);
    }
}

this is the code of .cs file the click event of button upload

1 Answer 1

1

This is not something you can implement properly using jQuery alone. You would need to use a component like NeatUpload, which includes a server-side module to track how much data is uploaded.

Sign up to request clarification or add additional context in comments.

2 Comments

ok.so now is there any other way so that i can implement it because i have implement functionality of upload using c#
If you're unable to use NeatUpload or something similar that integrates with your ASP.NET code, the only other way to get an upload progress bar is to use something Flash-based. Some popular options are SwfUpload, Uploadify, and Flajaxian. Personally, I've found these all to be a little unreliable in providing an accurate progress bar, and would recommend using something like NeatUpload if possible.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.