Link to home
Start Free TrialLog in
Avatar of indushyd
indushyd

asked on

Multiple File Upload

How to upload multiple files at a time?

In details...

A page contain one html editor. It facilitates user to create a page according to his requirement. Obiviously it may contains more than one image files which i want to upload at a time while submitting the page.

Note:- The html editor contain only the text. So there will not be any <FILE> for browsing. Only the image physical path will be present e.g.
<IMG src="c:\images\a.gif" align=left>
<IMG src="c:\images\b.gif" align=center>
<IMG src="c:\images\c.gif" align=right>

Avatar of joegass
joegass

Avatar of Mark Franz
ASPSimpleUpload http://www.asphelp.com/aspsimpleupload/ will do multiple uploads.

For more possibilities check here; http://hotscripts.com/ASP/Scripts_and_Components/File_Manipulation/Upload_Systems/

While most of these are free, remember that they are components and must be installed on your server, if you need a solution that has no components look into Pure ASP Upload.
Here is another excellent component, even the samples has a multiple image upload script already done!  :-)

http://www.websupergoo.com/abcupload-1.htm
Software Artisans SAFileUp is excellent, though you'll have to pay for it. It has a vary easy multiple file upload component. If you name your form's file input boxes the same thing, it's even easier.

Just do a simple For Each file in objFileUp.FormEx("Files").
I have provided a complete script and download for file uploads using plain vanilla server-side VBScript.

You need not install any components to use the script.

You will find the script under ASP section of my website, http://www.shastrynet.com/

Good luck...
shastry_yedavalli, it is an accepted practice here at EE to not lock a Q by submitting an answer to this type of question, one that can have many answers...

While your suggestion is a viable solution, I see every preceding comment as a solution also.  I do not see in your examples any method of uploading multiple files, plus you even state that your method can be a security hole.  Plus you even state that your method is not complete, what's up with that?  

This is not a viable answer...
Avatar of indushyd

ASKER

Required answer not found.
Are you talking about physically uploading a file from the users machine, or are they selecting a file already on the server?

If you want the user to select one of their local files, but you don't want to send this file to the server, you have NO CHANCE!!!

That's the whole thing with server/client relationships. If the client is not itself a server, then anyone else trying to access that image will be prevented.

If it's a file on the server that the user chooses, then that's not uploading you're looking at, but rather writing the path of the image (on the server) into your database.

So to summarise:

If you want to use images on the clients machine, those images wil have to be "uploaded" (with a file field) to the server.

If you're selecting images off the server, then look at using the FileSystemObject to select the imag in question, kind of like a windows explorer type-thing, where the user can open directories and select the images they want.
Yah!, I am talking about physically uploading a file from the users machine. In my script there is no file object present, only the file path that also i am finding programatically.
Right. You WILL needa file-upload component, or use the free do-it-yourself one available at https://www.experts-exchange.com/jsp/qShow.jsp?ta=asp&qid=20184197

Then you have to send those files from the Client to the Server, at which point the server then saves the files to a local directory and writes that path to the database.

If you're thinking about me as a user selecting a file "D:\user\temp\something.doc" and then for you to write that string to the database, then you've got it wrong. Your server will need that file sent to it from the client. You then need to get that file, and save it on the server.

check out any of the above suggestions. We know what you're trying to do, and these are the ways of doing it.
If on my file system, I have a file C:\something\something\test.doc, I doubt it very much if that same file in that same location will be present on the server? Unless of course, the client and server are the same machine, and this application can only ever be used from the same machine that's holding the server? Then what's the point of that?
SOLUTION
Avatar of AlfaNoMore
AlfaNoMore

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
indushyd, what do you mean "no answer found", what you request is simple if yo ujust think about it.  Look at this example;

This file create a page that has 2 file upload boxes,

<html>
<body>
<form method="post" action="imageupload.asp" enctype="multipart/form-data">
<input type="file" name="image1"><br>
<input type="file" name="image2"><br>
<input type="submit" name="submit" value="submit">
</form>
<body>
</html>

And this file processes the files;

<% @Language="VBScript" %>
<%
Set theForm = Server.CreateObject("ABCUpload4.XForm")
theForm.Overwrite = True
Set theField = theForm("image1")(1)
If theField.FileExists Then theField.Save theField.FileName
Set theField = theForm("image2")(1)
If theField.FileExists Then theField.Save theField.FileName
%>
<html>
<body>
Images uploaded...
</body>
</html>

The above example uses the ABCUpload component found at http://www.websupergoo.com/abcupload-1.htm  It really doesn't get any easier than this.  You can change the file name, change the path, just about anything... read the docs.

It doesn't get any simpler, really.

This thread has gone on long enough for only 50 points.
Yeah, but indushyd wants to NOT have a file upload form field, he wants to have text fields, and he wants these to send files from the client to the server, without uploading them!!!

Hmmm, I'm thinking things aren't quite going to happen like this, are they? :-)
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
[split b/w AlfaNoMore and mgfranz(Accepted)]

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

hongjun
EE Cleanup Volunteer