Multiple file uploads

B

!!bogus

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>
 
R

Roland Hall

: 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
 
B

Bullschmidt

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...
 
R

Roland Hall

in message : 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
 
B

Bullschmidt

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

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...
 
R

Roland Hall

in message : <<
: 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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top