multiple files upload

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default multiple files upload

    Hi Group,

    In my program, the user has to be able to add one or more documents (as
    files) for one product from the database.
    The number of files to be uploaded can vary from 1 to maybe 30-40 and each
    one will receive a number in a sort order,
    I understand that there is no way to let the user dynamically choose
    multiple files and submit them all at once (like for example as full paths
    in a listbox), so I have to put a <input type=file...> for each file to be
    uploaded.

    Though, what I would like to do is to be able to modify the number of
    displayed <input type=file...> controls on the page, so that I do not have
    to always display the maximum number of controls (and this might not work
    for some situations - what if the user wants to upload 41 files instead of a
    maximum, let's say, of 40 ?)

    What do you think ? Is this a good approach ? Can it be handled other ways ?

    Thank you for any suggestions,

    Andrei.


    andrei Guest

  2. Similar Questions and Discussions

    1. upload multiple files
      Hi, I have the form where user can upload max to three files at the same time. Also the file is need to be overrtie if user try to post the same...
    2. upload multiple files is this possible?
      Hi guys! is this possible to upload a whole directory or at least all files in a directory at once ? I know how to do it with 10 files then you...
    3. Upload of multiple files with Chilisoft
      The webhotel I use has installed Chilisoft. I wish to make a webpage where it is possible to upload files. So far I have only been able to upload...
    4. [PHP] Multiple upload files with php problem!!
      This is supported in the standards I think, as it says clearly in the HTML 4.01 specification on www.w3.org: "file select - This control type...
    5. Multiple upload files with php
      Hi, I need to upload multiples files using php, but with the same "<input>" tag, somebody can help my, is this feature supported by php?. Anyboy...
  3. #2

    Default Re: multiple files upload

    I thnk it's a great approach. Let your user pick the number of controls to
    add, and then do a PostBack and add the controls to the page. On the Server
    Side, Request.Files is already a single Collection, and all you have to do
    is loop through it to get all the files; no need to know how many there are.

    HTH,

    Kevin Spencer
    Microsoft FrontPage MVP
    Internet Developer
    [url]http://www.takempis.com[/url]
    Big things are made up of
    lots of Little things.

    "andrei" <andrei.toma@era-environmental.com> wrote in message
    news:%23H1ijmzODHA.2284@TK2MSFTNGP11.phx.gbl...
    > Hi Group,
    >
    > In my program, the user has to be able to add one or more documents (as
    > files) for one product from the database.
    > The number of files to be uploaded can vary from 1 to maybe 30-40 and each
    > one will receive a number in a sort order,
    > I understand that there is no way to let the user dynamically choose
    > multiple files and submit them all at once (like for example as full paths
    > in a listbox), so I have to put a <input type=file...> for each file to be
    > uploaded.
    >
    > Though, what I would like to do is to be able to modify the number of
    > displayed <input type=file...> controls on the page, so that I do not have
    > to always display the maximum number of controls (and this might not work
    > for some situations - what if the user wants to upload 41 files instead of
    a
    > maximum, let's say, of 40 ?)
    >
    > What do you think ? Is this a good approach ? Can it be handled other ways
    ?
    >
    > Thank you for any suggestions,
    >
    > Andrei.
    >
    >

    Kevin Spencer Guest

  4. #3

    Default Re: multiple files upload

    Hi,
    Why not use client script to add an additional "file" control at the click
    of a button. This way a new file control would be shown to the client
    without a postback.
    The control name too can be arrived at dynamically using some name-number
    combination.
    When a post-back does occur, you could probably loop through all the file
    controls and extract the file contents.

    Have not tried this, but should to possible to implement.

    Hope this helps,
    Sankalp



    "andrei" <andrei.toma@era-environmental.com> wrote in message
    news:%23H1ijmzODHA.2284@TK2MSFTNGP11.phx.gbl...
    > Hi Group,
    >
    > In my program, the user has to be able to add one or more documents (as
    > files) for one product from the database.
    > The number of files to be uploaded can vary from 1 to maybe 30-40 and each
    > one will receive a number in a sort order,
    > I understand that there is no way to let the user dynamically choose
    > multiple files and submit them all at once (like for example as full paths
    > in a listbox), so I have to put a <input type=file...> for each file to be
    > uploaded.
    >
    > Though, what I would like to do is to be able to modify the number of
    > displayed <input type=file...> controls on the page, so that I do not have
    > to always display the maximum number of controls (and this might not work
    > for some situations - what if the user wants to upload 41 files instead of
    a
    > maximum, let's say, of 40 ?)
    >
    > What do you think ? Is this a good approach ? Can it be handled other ways
    ?
    >
    > Thank you for any suggestions,
    >
    > Andrei.
    >
    >

    Sankalp Guest

  5. #4

    Default Re: multiple files upload

    The only PostBack would be the one that adds the "input type=file" elements
    to the page. At that point, the user inputs the files, and submits the form.
    No additional PostBacks necessary. On the server side, you just grab the
    Request.Files Collection. You don't even need to know how many inputs were
    added; the number will be Request.Files.Count.

    HTH,

    Kevin Spencer
    Microsoft FrontPage MVP
    Internet Developer
    [url]http://www.takempis.com[/url]
    Big things are made up of
    lots of Little things.

    "andrei" <andrei.toma@era-environmental.com> wrote in message
    news:%238oq79APDHA.4024@tk2msftngp13.phx.gbl...
    > Thank you, Kevin and Sankalp, for your feedback.
    >
    > I tried both options (client side only vs. round trip to the server to add
    > controls there)
    > Although the client side solution looked better (faster), what if there is
    a
    > need for a postback before actually uploading the files ? I will loose all
    > the dynamically added controls after a reload of the hmtl...
    >
    > So the solution is to show at the beginning a reasonable number of file
    > controls (10, for ex.). If the users need more, they will provide the
    number
    > and click a button, so another "n" controls will be added from the
    > code-behind.
    >
    > Andrei.
    >
    >

    Kevin Spencer Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139