Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8853235
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T13:36:08+00:00 2026-06-14T13:36:08+00:00

i have a AsyncFileUpload control : <asp:AsyncFileUpload ID=venfileupld runat=server OnUploadedComplete=ProcessUpload /> on its OnUploadedComplete

  • 0

i have a AsyncFileUpload control :

<asp:AsyncFileUpload ID="venfileupld" runat="server" OnUploadedComplete="ProcessUpload" />

on its OnUploadedComplete event i am writing this code :

protected void ProcessUpload(object sender, AjaxControlToolkit.AsyncFileUploadEventArgs e)
{
    string name = venfileupld.FileName.ToString();
    string filepath = "upload_excel/" + name;
    venfileupld.SaveAs(Server.MapPath(name));

}

now i have to read the content of the uploaded file … i have a function for that:

public void writetodb(string filename)
{
    string[] str;
    string vcode = "";
    string pswd = "";
    string vname = "";
    StreamReader sr = new StreamReader(filename);
    string line="";

    while ((line = sr.ReadLine()) != null)
    {
        str = line.Split(new char[] { ',' });
        vcode = str[0];
        pswd = str[1];
        vname = str[2];
        insertdataintosql(vcode, pswd, vname);
    }
    lblmsg4.Text = "Data Inserted Sucessfully";
}

now my query is that how i can get the uploaded file to pass to this function ?

UPDATE

i have done this :

protected void ProcessUpload(object sender, AjaxControlToolkit.AsyncFileUploadEventArgs e)
{
    string name = venfileupld.FileName.ToString();
    string filepath = "upload_excel/" + name;
    venfileupld.SaveAs(Server.MapPath(name));
    string filename = System.IO.Path.GetFileName(e.FileName);
    writetodb(filepath);

}

but getting an error… file not found

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T13:36:10+00:00Added an answer on June 14, 2026 at 1:36 pm

    I’m not sure if i have understood the problem, but isn’t it easy as:

    protected void ProcessUpload(object sender, AjaxControlToolkit.AsyncFileUploadEventArgs e)
    {
        string name = System.IO.Path.GetFileName(e.filename);
        string dir = Server.MapPath("upload_excel/");
        string path = Path.Combine(dir, name);
        venfileupld.SaveAs(path);
        writetodb(path);
    }
    

    SaveAs will save the file on the server, so you can do what you want with it afterwards.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code in AsyncFileUpload's upload complete event handler: Protected Sub AsyncFileUpload1_UploadedComplete(ByVal
Have a look at this code sample or go to the jsfiddle function printRelation(a,
I am using ajax toolkit asyncFileUpload control I had problem that my server side
have a php code like this,going to convert it in to C#. function isValid($n){
I have an asyncfileupload control that I'm using from the ajaxcontroltoolkit. On the file
I have a asp:FileUpload control in my page. The default file size is 4MB.
Have following listener for keyboard ArrowDown event(it's key code is 40 ): window.onload =
I have a file upload page with an AsyncFileUpload control. When the user browses
I have an asyncfileupload control inside an update panel. The file succesfully upload and
Working with the asp.net AsyncFileUpload control. Is it an asynchronies process? I noticed when

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.