473,399 Members | 3,888 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Multiple file uploads

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.

If I should use the httpfilecollection, can you give me an example?

<%@ 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\uploadf ile.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
Jul 21 '05 #1
0 1163

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: 3A Web Hosting | last post by:
Hi Is it possible to perform multiple file uploads via a form? It's no problem uploading single files but I want to be able to highlight a group of files and upload them all in one go. My...
5
by: Kikoz | last post by:
Hi all. I assume that if the user uploads a file from aspx page IIS will put all future requests to the same page from other users in a line and all of them will be waiting until this upload...
3
by: darrel | last post by:
My understanding is that using the FILE form element to allow a file upload is limited to one unique file per page. Is that correct? Any thoughts on how best to design an interface to allow...
4
by: Steven | last post by:
I have a situation where I need to upload more than one file from a client to the server, I am having problems finding any examples of how I can ahhieve my goal. My Requirements are: 1, There...
4
by: yehaimanish | last post by:
I am developing the project management system. Each Project: 1. Title, description ... , stored in mysql database 2. Upto ten files (initial description), (name in db, file in file system) 3....
0
by: leen | last post by:
hola.. i need a help...this is my coding for uploading multiple files...the problem is..i want the files that i have been upload will show in the same page but using only one text box..can anyone...
6
by: Emmanuel Petit | last post by:
First of all I am rather new into PHP. I use php 5 and I am putting together a web site for a local association I belong too. Most of the site is okay, except for this problem : I need to be...
9
by: Jankie | last post by:
<?php if(isset($_POST) && $_FILES > 0){ foreach ($_FILES as $key => $error) { $name = $_FILES; $tempname = $_FILES; ………… ……… $path = 'uploads/'; include 'dbcon.php'; $rep = strpos($_FILES,...
0
by: santoshannamalai | last post by:
Hi, I would like to know what technology does rapidshare use to manage its multiple, large file uploads. Rapidshare has thousands of users. Still Rapidshare manages to maintain the uploads onto...
4
by: MoroccoIT | last post by:
Greetings - I saw somewhat similar code (pls see link below) that does mupltiple files upload. It works fine, but I wanted to populate the database with the same files that are uploaded to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.