File Upload

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • shapper

    File Upload

    Hello,

    I need to upload a file. Can I only do this with the File Upload
    control?

    I also need the following:

    - Send upload info, upload percentage, continuously to a JavaScript
    function so I can display the Upload Progress.

    - The controls would be inside an Update Panel.

    Before I start to upload a file I send data to a database. This is
    done.

    After the data has been inserted in database the file upload would
    start.

    The Upload Panel would "finish" when the file finishes upload.

    Is this possible?

    Could I get some help on this?

    Thanks,

    Miguel
  • Anthony Jones

    #2
    Re: File Upload

    "shapper" <mdmoura@gmail. comwrote in message
    news:db7c3f3b-5261-4041-8063-4ea06e8f4940@d2 1g2000prf.googl egroups.com...
    Hello,
    >
    I need to upload a file. Can I only do this with the File Upload
    control?
    >
    I also need the following:
    >
    - Send upload info, upload percentage, continuously to a JavaScript
    function so I can display the Upload Progress.
    >
    Unfortunately there is currently no support in browsers to support this.
    You would need an extra component installed on the client that can handle
    the upload and provide a means of displaying a progress bar (typically a
    progress event that can be consumes by the sites Javascript).

    - The controls would be inside an Update Panel.
    >
    Before I start to upload a file I send data to a database. This is
    done.
    >
    After the data has been inserted in database the file upload would
    start.
    >
    What happens if the upload fails? Do you need to reverse out the DB changes?

    Consider uploading to a temporary location first, then a post to the server
    can update the database and move the file from its temporary location to its
    persistent location in a more atomic operation. If the upload fails, you've
    not got rubbish in your DB that you need to clear up.
    The Upload Panel would "finish" when the file finishes upload.
    >
    Is this possible?
    >
    Without client side component support the only way to upload a file is via a
    Form post from the browser. Unfortunately Form posts were never intended to
    carry large amounts of data and therefore no thought has been given to
    providing the user with progress info on the upload.

    If you're desperate then you might get away with performing the Form post
    from a page in an IFrame, you could have a progress bar in the host page
    polling the server and retrieving the size of the temporary file. I'm not
    entirely sure how you would retrieve the expected final size of the file
    though (I'm not familiar with the file upload control where you might expect
    to get that info, I use a client side component instead).


    --
    Anthony Jones - MVP ASP/ASP.NET


    Comment

    • Jevon

      #3
      Re: File Upload

      I've previously come across (but not yet used)
      http://www.brettle.com/neatupload - have you seen this yet? I have no idea
      if it can be used with an UpdatePanel, but I think it does the other stuff
      you mention.

      I agree with Anthony though, ideally you shouldn't be updating anything in
      the database until you have the file on the server to work with.

      Jevon


      "shapper" <mdmoura@gmail. comwrote in message
      news:db7c3f3b-5261-4041-8063-4ea06e8f4940@d2 1g2000prf.googl egroups.com...
      Hello,
      >
      I need to upload a file. Can I only do this with the File Upload
      control?
      >
      I also need the following:
      >
      - Send upload info, upload percentage, continuously to a JavaScript
      function so I can display the Upload Progress.
      >
      - The controls would be inside an Update Panel.
      >
      Before I start to upload a file I send data to a database. This is
      done.
      >
      After the data has been inserted in database the file upload would
      start.
      >
      The Upload Panel would "finish" when the file finishes upload.
      >
      Is this possible?
      >
      Could I get some help on this?
      >
      Thanks,
      >
      Miguel

      Comment

      • Ilyas

        #4
        Re: File Upload

        On 12 Feb, 10:52, "Jevon" <ple...@ask.com wrote:
        I've previously come across (but not yet used)http://www.brettle.com/neatupload- have you seen this yet? I have no idea
        if it can be used with an UpdatePanel, but I think it does the other stuff
        you mention.
        >
        I agree with Anthony though, ideally you shouldn't be updating anything in
        the database until you have the file on the server to work with.
        >
        Jevon
        >
        "shapper" <mdmo...@gmail. comwrote in message
        >
        news:db7c3f3b-5261-4041-8063-4ea06e8f4940@d2 1g2000prf.googl egroups.com...
        >
        >
        >
        Hello,
        >
        I need to upload a file. Can I only do this with the File Upload
        control?
        >
        I also need the following:
        >
        - Send upload info, upload percentage, continuously to a JavaScript
        function so I can display the Upload Progress.
        >
        - The controls would be inside an Update Panel.
        >
         Before I start to upload a file I send data to a database. This is
        done.
        >
         After the data has been inserted in database the file upload would
        start.
        >
         The Upload Panel would "finish" when the file finishes upload.
        >
        Is this possible?
        >
        Could I get some help on this?
        >
        Thanks,
        >
        Miguel- Hide quoted text -
        >
        - Show quoted text -
        Telerik have a file upload control which can do exactly this
        See http://www.telerik.com/products/aspn.../overview.aspx

        Comment

        Working...