Multiple file uploads

Discussion in 'ASP General' started by !!bogus, Jan 25, 2005.

  1. !!bogus

    !!bogus Guest

    Hi,

    I found this code in the MSDN library. It works fine for a single upload,
    but I can't figure out how to make it work for multiple file uploads...can
    someone please help me?

    Just paste it in an aspx file and it will work. Although I don't see the
    HtmlInputFile class or the fileupload.aspx class that it refers to, it
    somehow works.


    <%@ Page Language="VB" AutoEventWireup="True" %>
    <html>
    <script runat="server">
    Sub UploadBtn_Click(Sender as Object, e as EventArgs)

    ' Display information about posted file
    FileName.InnerHtml = MyFile.PostedFile.FileName
    MyContentType.InnerHtml = MyFile.PostedFile.ContentType
    ContentLength.InnerHtml = cStr(MyFile.PostedFile.ContentLength)
    FileDetails.Visible = True

    ' Save uploaded file to server
    MyFile.PostedFile.SaveAs("c:\Uploadedfiles\uploadfile.txt")
    End Sub
    </script>
    <body>
    <form action="fileupload.aspx"
    method="post"
    enctype="multipart/form-data"
    runat="server">

    <h1>ASP.NET File Upload Example</h1>
    Select File To Upload to Server:
    <input id="MyFile"
    type="file"
    runat="server">
    <br><br>
    <input type=submit
    value="Upload!"
    OnServerclick="UploadBtn_Click"
    runat="server">
    <br><br><br>
    <div id="FileDetails"
    Visible=false
    runat="server">
    FileName: <span id="FileName" runat="server"/> <br>
    ContentType: <span id="MyContentType" runat="server"/> <br>
    ContentLength: <span id="ContentLength" runat="server"/>bytes
    <br>
    </div>
    </form>
    </body>
    </html>


    --
    Thank you
    Please post only
     
    !!bogus, Jan 25, 2005
    #1
    1. Advertising

  2. !!bogus

    Roland Hall Guest

    "!!bogus" <> wrote in message
    news:IKkJd.1667$...
    : Hi,
    :
    : I found this code in the MSDN library. It works fine for a single upload,
    : but I can't figure out how to make it work for multiple file uploads...can
    : someone please help me?
    :
    : Just paste it in an aspx file and it will work. Although I don't see the
    : HtmlInputFile class or the fileupload.aspx class that it refers to, it
    : somehow works.

    <!--SNiP-->

    All ASP.NET groups have dotnet in the name.

    --
    Roland Hall
    /* This information is distributed in the hope that it will be useful, but
    without any warranty; without even the implied warranty of merchantability
    or fitness for a particular purpose. */
    Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
    WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
    MSDN Library - http://msdn.microsoft.com/library/default.asp
     
    Roland Hall, Jan 25, 2005
    #2
    1. Advertising

  3. !!bogus

    Bullschmidt Guest

    And here is a classic ASP resource for letting the user upload one or
    more files which is something that was unfortunately not built into ASP:

    ASP File Upload Using VBScript by John R. Lewis - 7/10/2000
    http://aspzone.com/posts/160.aspx

    Best regards,
    J. Paul Schmidt, Freelance ASP Web Developer
    http://www.Bullschmidt.com
    ASP Design Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Bullschmidt, Jan 26, 2005
    #3
  4. !!bogus

    Roland Hall Guest

    "Bullschmidt" wrote in message news:...
    : And here is a classic ASP resource for letting the user upload one or
    : more files which is something that was unfortunately not built into ASP:
    :
    : ASP File Upload Using VBScript by John R. Lewis - 7/10/2000
    : http://aspzone.com/posts/160.aspx

    Perhaps since he's already using .NET, he should stick with that?!
    http://www.ondotnet.com/pub/a/dotnet/2002/04/01/asp.html

    --
    Roland Hall
    /* This information is distributed in the hope that it will be useful, but
    without any warranty; without even the implied warranty of merchantability
    or fitness for a particular purpose. */
    Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
    WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
    MSDN Library - http://msdn.microsoft.com/library/default.asp
     
    Roland Hall, Jan 26, 2005
    #4
  5. !!bogus

    Bullschmidt Guest

    <<
    Perhaps since he's already using .NET, he should stick with that?!
    http://www.ondotnet.com/pub/a/dotnet/2002/04/01/asp.html

    --
    Roland Hall
    >>


    True (good point), but the topic is "Multiple file uploads" in a classic
    ASP newsgroup and perhaps there is always at least the slightest
    possibility that someone else may search this newsgroup in the future
    actually looking to find an answer to the question. :)

    Best regards,
    J. Paul Schmidt, Freelance ASP Web Developer
    http://www.Bullschmidt.com
    ASP Design Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Bullschmidt, Jan 26, 2005
    #5
  6. !!bogus

    Roland Hall Guest

    "Bullschmidt" wrote in message news:eO2$...
    : <<
    : Perhaps since he's already using .NET, he should stick with that?!
    : http://www.ondotnet.com/pub/a/dotnet/2002/04/01/asp.html
    :
    : --
    : Roland Hall
    : >>
    :
    : True (good point), but the topic is "Multiple file uploads" in a classic
    : ASP newsgroup and perhaps there is always at least the slightest
    : possibility that someone else may search this newsgroup in the future
    : actually looking to find an answer to the question. :)

    Ok, fair enough but don't think you won't be answering this same question
    again. (O;=

    --
    Roland Hall
    /* This information is distributed in the hope that it will be useful, but
    without any warranty; without even the implied warranty of merchantability
    or fitness for a particular purpose. */
    Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
    WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
    MSDN Library - http://msdn.microsoft.com/library/default.asp
     
    Roland Hall, Jan 26, 2005
    #6
    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. Ryan Ternier

    Multiple File Uploads

    Ryan Ternier, Jul 7, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    391
    Kevin Spencer
    Jul 8, 2004
  2. darrel
    Replies:
    3
    Views:
    394
    darrel
    Mar 21, 2005
  3. =?Utf-8?B?U3RldmVu?=

    Multiple File Uploads

    =?Utf-8?B?U3RldmVu?=, Apr 4, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    365
    =?Utf-8?B?U3RldmVuIE1DUCwgTUNBRA==?=
    Apr 4, 2006
  4. news.amnet.net.au

    Multiple file uploads with applet

    news.amnet.net.au, Feb 12, 2004, in forum: Java
    Replies:
    0
    Views:
    1,879
    news.amnet.net.au
    Feb 12, 2004
  5. gberz3
    Replies:
    7
    Views:
    197
    Todd Fisher
    Jul 24, 2008
Loading...

Share This Page