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>

indushydAsked:
Who is Participating?
 
mgfranzConnect With a Mentor Commented:
Wait a minute...  He wants a memo field populated with basic HTML code;

<textarea cols="40" rows="10" name="test">This is a test, the images inside here need to be uploaded, <img src="c:\inetpub\wwwroot\images\test.gif" border="0">, and another one is <img src="c:\inetpub\wwwroot\images\test2.gif" border="0">.</textarea>

And then the images inside this textarea needs to be pulled out for uploading?

Yes, it can be done, using a few functions and some RegExp, but not for 50 points!  More like 300!
0
 
joegassCommented:
0
 
mgfranzCommented:
ASPSimpleUpload http://www.asphelp.com/aspsimpleupload/ will do multiple uploads.

0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
mgfranzCommented:
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.
0
 
mgfranzCommented:
Here is another excellent component, even the samples has a multiple image upload script already done!  :-)

http://www.websupergoo.com/abcupload-1.htm
0
 
AlfaNoMoreCommented:
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").
0
 
shastry_yedavalliCommented:
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...
0
 
mgfranzCommented:
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...
0
 
indushydAuthor Commented:
Required answer not found.
0
 
AlfaNoMoreCommented:
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.
0
 
indushydAuthor Commented:
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.
0
 
AlfaNoMoreCommented:
Right. You WILL needa file-upload component, or use the free do-it-yourself one available at http://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.
0
 
AlfaNoMoreCommented:
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?
0
 
AlfaNoMoreConnect With a Mentor Commented:
This is a owerful looking freebee: http://www.asp101.com/articles/jacob/scriptupload.asp
0
 
mgfranzCommented:
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.
0
 
AlfaNoMoreCommented:
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? :-)
0
 
hongjunCommented:
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
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.