FileUpload Control within UpdatePanel

Discussion in 'ASP .Net' started by GaryDean, May 4, 2008.

  1. GaryDean

    GaryDean Guest

    Is there any way to make an asp FileUpload control work within an
    UpdatePanel?
    Thanks,
    Garyh
    GaryDean, May 4, 2008
    #1
    1. Advertising

  2. GaryDean

    bruce barker Guest

    no. the update panel uses xmlhttprequest to post the form data which can
    not access a file. you can use javascript and hidden iframes to upload a
    file.

    -- bruce (sqlwork.com)

    GaryDean wrote:
    > Is there any way to make an asp FileUpload control work within an
    > UpdatePanel?
    > Thanks,
    > Garyh
    >
    >
    >
    bruce barker, May 5, 2008
    #2
    1. Advertising

  3. GaryDean

    marss Guest

    marss, May 5, 2008
    #3
  4. Hi Gary,

    You can have a look at the blog article from marss. Here are some other
    articles I've found mentioned some approaches create ajax stile uploading:

    #Simple AJAX File Upload
    http://www.codeproject.com/KB/ajax/simpleajaxupload.aspx

    #Create An Ajax Style File Upload
    http://geekswithblogs.net/rashid/archive/2007/08/01/Create-An-Ajax-Style-Fil
    e-Upload.aspx

    However, I still think directly put fileupload into updatepanel maybe
    problem prone since it is not designed to hold fileupload task(multi-part
    form data). Is there any particular requirement that you have to make file
    upload via ajax style?

    Sincerely,

    Steven Cheng

    Microsoft MSDN Online Support Lead


    Delighting our customers is our #1 priority. We welcome your comments and
    suggestions about how we can improve the support we provide to you. Please
    feel free to let my manager know what you think of the level of service
    provided. You can send feedback directly to my manager at:
    .

    ==================================================
    Get notification to my posts through email? Please refer to
    http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
    ications.

    Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
    where an initial response from the community or a Microsoft Support
    Engineer within 1 business day is acceptable. Please note that each follow
    up response may take approximately 2 business days as the support
    professional working with you may need further investigation to reach the
    most efficient resolution. The offering is not appropriate for situations
    that require urgent, real-time or phone-based interactions or complex
    project analysis and dump analysis issues. Issues of this nature are best
    handled working with a dedicated Microsoft Support Engineer by contacting
    Microsoft Customer Support Services (CSS) at
    http://msdn.microsoft.com/subscriptions/support/default.aspx.
    ==================================================
    This posting is provided "AS IS" with no warranties, and confers no rights.

    --------------------
    >From: "GaryDean" <>
    >Subject: FileUpload Control within UpdatePanel
    >Date: Sun, 4 May 2008 12:58:12 -0700
    >
    >Is there any way to make an asp FileUpload control work within an
    >UpdatePanel?
    >Thanks,
    >Garyh
    >
    >
    >
    >
    Steven Cheng [MSFT], May 5, 2008
    #4
  5. GaryDean

    bruce barker Guest

    you can upload file data via xmlhttprequest (its just base64 encode, easy
    enough to do with javascript), you just can not read the file with javascript
    to get the data.

    -- bruce (sqlwork.com)


    "Steven Cheng [MSFT]" wrote:

    > Hi Gary,
    >
    > You can have a look at the blog article from marss. Here are some other
    > articles I've found mentioned some approaches create ajax stile uploading:
    >
    > #Simple AJAX File Upload
    > http://www.codeproject.com/KB/ajax/simpleajaxupload.aspx
    >
    > #Create An Ajax Style File Upload
    > http://geekswithblogs.net/rashid/archive/2007/08/01/Create-An-Ajax-Style-Fil
    > e-Upload.aspx
    >
    > However, I still think directly put fileupload into updatepanel maybe
    > problem prone since it is not designed to hold fileupload task(multi-part
    > form data). Is there any particular requirement that you have to make file
    > upload via ajax style?
    >
    > Sincerely,
    >
    > Steven Cheng
    >
    > Microsoft MSDN Online Support Lead
    >
    >
    > Delighting our customers is our #1 priority. We welcome your comments and
    > suggestions about how we can improve the support we provide to you. Please
    > feel free to let my manager know what you think of the level of service
    > provided. You can send feedback directly to my manager at:
    > .
    >
    > ==================================================
    > Get notification to my posts through email? Please refer to
    > http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
    > ications.
    >
    > Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
    > where an initial response from the community or a Microsoft Support
    > Engineer within 1 business day is acceptable. Please note that each follow
    > up response may take approximately 2 business days as the support
    > professional working with you may need further investigation to reach the
    > most efficient resolution. The offering is not appropriate for situations
    > that require urgent, real-time or phone-based interactions or complex
    > project analysis and dump analysis issues. Issues of this nature are best
    > handled working with a dedicated Microsoft Support Engineer by contacting
    > Microsoft Customer Support Services (CSS) at
    > http://msdn.microsoft.com/subscriptions/support/default.aspx.
    > ==================================================
    > This posting is provided "AS IS" with no warranties, and confers no rights.
    >
    > --------------------
    > >From: "GaryDean" <>
    > >Subject: FileUpload Control within UpdatePanel
    > >Date: Sun, 4 May 2008 12:58:12 -0700
    > >
    > >Is there any way to make an asp FileUpload control work within an
    > >UpdatePanel?
    > >Thanks,
    > >Garyh
    > >
    > >
    > >
    > >

    >
    >
    bruce barker, May 5, 2008
    #5
  6. Thanks for your input Bruce,

    Yes, client-side script cannot directly access local file system and read
    data. In web page, it will require the user to interactively select and use
    html file input to upload file.

    Sincerely,

    Steven Cheng

    Microsoft MSDN Online Support Lead


    Delighting our customers is our #1 priority. We welcome your comments and
    suggestions about how we can improve the support we provide to you. Please
    feel free to let my manager know what you think of the level of service
    provided. You can send feedback directly to my manager at:
    .

    ==================================================
    Get notification to my posts through email? Please refer to
    http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
    ications.

    ==================================================
    This posting is provided "AS IS" with no warranties, and confers no rights.

    --------------------

    >From: =?Utf-8?B?YnJ1Y2UgYmFya2Vy?= <>
    >References: <#>

    <>
    >Subject: RE: FileUpload Control within UpdatePanel
    >Date: Mon, 5 May 2008 09:21:01 -0700


    >
    >you can upload file data via xmlhttprequest (its just base64 encode, easy
    >enough to do with javascript), you just can not read the file with

    javascript
    >to get the data.
    >
    >-- bruce (sqlwork.com)
    >
    >
    >"Steven Cheng [MSFT]" wrote:
    >
    >> Hi Gary,
    >>
    >> You can have a look at the blog article from marss. Here are some other
    >> articles I've found mentioned some approaches create ajax stile

    uploading:
    >>
    >> #Simple AJAX File Upload
    >> http://www.codeproject.com/KB/ajax/simpleajaxupload.aspx
    >>
    >> #Create An Ajax Style File Upload
    >>

    http://geekswithblogs.net/rashid/archive/2007/08/01/Create-An-Ajax-Style-Fil
    >> e-Upload.aspx
    >>
    >> However, I still think directly put fileupload into updatepanel maybe
    >> problem prone since it is not designed to hold fileupload

    task(multi-part
    >> form data). Is there any particular requirement that you have to make

    file
    >> upload via ajax style?
    >>
    >> Sincerely,
    >>
    >> Steven Cheng
    >>
    >> Microsoft MSDN Online Support Lead
    >>
    >>
    >> Delighting our customers is our #1 priority. We welcome your comments

    and
    >> suggestions about how we can improve the support we provide to you.

    Please
    >> feel free to let my manager know what you think of the level of service
    >> provided. You c
    Steven Cheng [MSFT], May 6, 2008
    #6
  7. GaryDean

    Anil Abraham Guest

    On May 5, 12:58 am, "GaryDean" <> wrote:
    > Is there any way to make an aspFileUploadcontrolwork within anUpdatePanel?
    > Thanks,
    > Garyh


    yes make use of trigerrs as follows

    <Triggers>
    <asp:postBackTrigger ControlID="btnUpload" />
    </Triggers>
    Anil Abraham, May 28, 2008
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    1
    Views:
    481
  2. Bogdan
    Replies:
    2
    Views:
    2,253
    Bogdan
    Aug 10, 2009
  3. Mario

    FileUpload in UpdatePanel

    Mario, Jun 1, 2010, in forum: ASP .Net
    Replies:
    1
    Views:
    519
  4. Ne7ven
    Replies:
    0
    Views:
    1,696
    Ne7ven
    Apr 18, 2011
  5. Jeremy

    fileupload fails in updatepanel

    Jeremy, Dec 12, 2007, in forum: ASP .Net Web Controls
    Replies:
    3
    Views:
    231
    PJ on Development
    Dec 17, 2007
Loading...

Share This Page