navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

Microsoft MVP

 

upload many files to DataBase

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> upload many files to DataBase
Page: [1]
 
wizard_oz

 

Posts: 140
Joined: 9/3/2004
From: Ga,USA
Status: offline

 
upload many files to DataBase - 7/23/2005 9:11:10   
hi, I would like to upload some files to the server (asp) and insert them to my database, does anyone can help me with that?
Elen
Eli

 

Posts: 2658
From: ... er ...
Status: offline

 
RE: upload many files to DataBase - 7/23/2005 12:48:46   
you mean you want to upload files and insert the locations of the files into the database?

Try this: http://www.freeaspupload.net/

_____________________________

Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning

(in reply to wizard_oz)
wizard_oz

 

Posts: 140
Joined: 9/3/2004
From: Ga,USA
Status: offline

 
RE: upload many files to DataBase - 7/23/2005 13:12:40   
I would like to upload some files the a specific directory , that mean that I want to be able to choose the directory and upload files to that directory. But I want to use a code to not a software that someone wrote

(in reply to Eli)
rdouglass

 

Posts: 9269
From: Biddeford, ME USA
Status: offline

 
RE: upload many files to DataBase - 7/23/2005 15:00:22   
I have code that will upload multiple files from the same form but it doesn't allow the user to choose the directory. You probably could do that but the difficulty lies in ensuring the user has proper priviledges for that directory.

There also is some risk in showing the user the names and paths of the directories that have upload priv's. That can increase the risk of malicious upload. Forcing the directory doesn't negate that risk, just decrease it.

It is based on the scripts here:

http://www.asp101.com/articles/jacob/scriptupload.asp

Hope it helps.

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to wizard_oz)
wizard_oz

 

Posts: 140
Joined: 9/3/2004
From: Ga,USA
Status: offline

 
RE: upload many files to DataBase - 7/24/2005 5:01:31   
Is there another way to upload multiple files? any ideas?

(in reply to rdouglass)
rdouglass

 

Posts: 9269
From: Biddeford, ME USA
Status: offline

 
RE: upload many files to DataBase - 7/25/2005 11:16:58   
quote:

Is there another way to upload multiple files? any ideas?


Can you be very specific as to what you want to do and what it would look like?

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to wizard_oz)
wizard_oz

 

Posts: 140
Joined: 9/3/2004
From: Ga,USA
Status: offline

 
RE: upload many files to DataBase - 7/27/2005 15:42:23   
I would like to create a folder (this i did with objFSO) and my problem is to upload some files to that directory
How do I do it? I can upload 1 file to a cerain directory like spooki gave at the start of this page but I it's not good enough
please help me

(in reply to rdouglass)
rdouglass

 

Posts: 9269
From: Biddeford, ME USA
Status: offline

 
RE: upload many files to DataBase - 7/27/2005 16:01:00   
quote:

I would like to create a folder (this i did with objFSO) and my problem is to upload some files to that directory


The problem with doing it this way is that you have to be sure the created folder has the proper permissions for the IUSR_machinename account.

Did you look at the link I posted? I use a version of that to upload 4 files at a time and I can make it do as many as I want. It *does* do what you want it to do; please take a few minutes and look at this before you post again.

Part of the problem with this is that you *will* have to do *some* work. Everything posted here is generally examples and not "plug and play" code. We will help you a lot but it usually requires some effort from you too.

Please don't take that wrong; it's just that all your answers are right here in this post. Really, they are. :)

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to wizard_oz)
wizard_oz

 

Posts: 140
Joined: 9/3/2004
From: Ga,USA
Status: offline

 
RE: upload many files to DataBase - 7/31/2005 4:15:32   
Still can't do it. I created a folder with the person name and I would like to upload a file to that directory, I don't know how to choose that directory, I can choose the name from a combo box but how am I trnasfer it to the uplaod.asp code , I need help about it


(in reply to rdouglass)
wizard_oz

 

Posts: 140
Joined: 9/3/2004
From: Ga,USA
Status: offline

 
RE: upload many files to DataBase - 8/3/2005 4:08:35   
anyone???????????

(in reply to wizard_oz)
rdouglass

 

Posts: 9269
From: Biddeford, ME USA
Status: offline

 
RE: upload many files to DataBase - 8/3/2005 11:35:16   
What code are you currently using for uploading your files?

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to wizard_oz)
wizard_oz

 

Posts: 140
Joined: 9/3/2004
From: Ga,USA
Status: offline

 
RE: upload many files to DataBase - 8/3/2005 14:51:55   
I am using the code that spooky gave upload.zip and the code look like
<!--#include file="code/clsupload.asp"-->
<%
'#===========================
'# Allowable file extensions
'#===========================

sAllowedFiles 	= "zip,jpg,gif"

'#===========================
'# Upload size max in bytes
'#===========================

iUplSize 	= 200000

'#===========================
'# File path (based on the root of your web)
'#===========================

sUploadPath	= "/uploads"

'#===========================
'# Name of the text box that the
'# file name will be saved to.
'#===========================

TextBox		= "Upload"

Set Upload 	= New clsUpload
FileName 	= Upload.Fields("FileName").FileName
Ext 		= Upload("FileName").FileExt
	if inStr(uCase(sAllowedFiles),uCase(Ext)) > 0 then
		If Upload("FileName").Length <= iUplSize then
			Folder = Server.MapPath(sUploadPath)  & "\"
			FileName = Upload.UniqueName(Folder, FileName)
			Upload("FileName").SaveAs Folder & FileName
		Else
			errmessage = "File must be less than "& iUplSize/1000 & " kb"
		End if
	else
		errmessage = "File type not supported."
	end if
Set Upload = Nothing
%>
	<HTML>
	<HEAD>
	<SCRIPT LANGUAGE="JavaScript">
	<!--
	function copyForm() {
	    opener.document.Upload.<%=TextBox%>.value = document.popupForm.FileName.value;
	    document.popupForm.submit();
	    window.close();
	    return false;
	}
	//-->
	</SCRIPT>
	</HEAD>
	<%If len(errmessage) > 0 then%>
	<BODY>
	<%=errmessage%>
	<%Else%>
	<BODY onLoad="return copyForm()">
	<FORM NAME="popupForm" onSubmit="return copyForm()">
	<INPUT TYPE="TEXT" NAME="FileName" value="<%=FileName%>">
	<INPUT TYPE="BUTTON" VALUE="Submit" onClick="copyForm()">
	</FORM>
	<%end if%>
	</BODY>
	</HTML>

(in reply to rdouglass)
rdouglass

 

Posts: 9269
From: Biddeford, ME USA
Status: offline

 
RE: upload many files to DataBase - 8/3/2005 16:34:36   
quote:

'#===========================
'# File path (based on the root of your web)
'#===========================

sUploadPath = "/uploads"


That's where it's done. You'd need to change that to grab the dropdown selection and place it in the script for the variable "sUploadPath" and of course, ensure the folder is writeable.

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to wizard_oz)
wizard_oz

 

Posts: 140
Joined: 9/3/2004
From: Ga,USA
Status: offline

 
RE: upload many files to DataBase - 8/4/2005 7:52:49   
I know that what I need to do and that's the exact problem because the path is constant and my question is how to make it as a drop down list or I need to get the path from another ASP file (something like request.form)

(in reply to rdouglass)
Spooky

 

Posts: 26603
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: upload many files to DataBase - 8/4/2005 15:52:59   
To provide a variable path, youll need to send the value from the drop down
Use simple values in the drop down (eg 1,2,3).

sPath = Upload.Fields("Path").FileName
If sPath = "1" then
sUploadPath	= "/uploads1"
elseif sPath = "2" then
sUploadPath	= "/uploads2"
else
sUploadPath	= "/uploads"
end if


_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to wizard_oz)
wizard_oz

 

Posts: 140
Joined: 9/3/2004
From: Ga,USA
Status: offline

 
RE: upload many files to DataBase - 8/4/2005 17:24:42   
thanks for your support but this is not what i was looking for.
I create a form and when then client fill the form, it create a folder with the person name so he can upload as many picture as he wants, so you see I don't know the folders name. i can send the person name (the same as the folder name) to another ASP page, can I use your code and choose another folder from a diffrent ASP file? (like a request.form)?

(in reply to Spooky)
Spooky

 

Posts: 26603
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: upload many files to DataBase - 8/4/2005 17:36:25   
so your path would equal :
sUploadPath = "/username" ?

Would this work for you (assuming they have a session)?
sUploadPath = "/"&Session("username")

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to wizard_oz)
wizard_oz

 

Posts: 140
Joined: 9/3/2004
From: Ga,USA
Status: offline

 
RE: upload many files to DataBase - 8/4/2005 17:41:18   
no I am not using with session becasue only 1 person is uploading the pictures but he upload a diffrent person everytime

(in reply to Spooky)
Spooky

 

Posts: 26603
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: upload many files to DataBase - 8/4/2005 18:18:30   
So - he needs to select the persons name (and thus the directory?)

If thats the case - then shouldnt the drop down list contain the names of all the users?

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to wizard_oz)
wizard_oz

 

Posts: 140
Joined: 9/3/2004
From: Ga,USA
Status: offline

 
RE: upload many files to DataBase - 8/4/2005 18:38:15   
yes that's what I need

(in reply to Spooky)
Spooky

 

Posts: 26603
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: upload many files to DataBase - 8/4/2005 18:59:28   
So, youd do as per my instructions above, but use the username.
You can extract those values from a database or hard code them.
Id do the later while I was testing.

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to wizard_oz)
wizard_oz

 

Posts: 140
Joined: 9/3/2004
From: Ga,USA
Status: offline

 
RE: upload many files to DataBase - 8/4/2005 19:05:39   
Sorry I didn't get your point. How do I send to your upload.asp the name? and how do I use the path with the name I got ?

(in reply to Spooky)
Spooky

 

Posts: 26603
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: upload many files to DataBase - 8/5/2005 0:04:19   
In your first form you may have :

<select name="Username">
<option>Name1</option>
<option>Name2</option>
<option>Name3</option>
</select>

Then, in the upload page :
sUploadPath = Upload.Fields("Username").FileName


_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to wizard_oz)
wizard_oz

 

Posts: 140
Joined: 9/3/2004
From: Ga,USA
Status: offline

 
RE: upload many files to DataBase - 8/5/2005 7:03:33   
at your example (upload.zip) am I doing it at the file upload.asp or upload_demo.htm? (this is my first time using these application)

(in reply to Spooky)
Spooky

 

Posts: 26603
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: upload many files to DataBase - 8/5/2005 16:08:27   
You enter the file and directory name in upload.asp and the path changes in the processing page

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to wizard_oz)
wizard_oz

 

Posts: 140
Joined: 9/3/2004
From: Ga,USA
Status: offline

 
RE: upload many files to DataBase - 8/7/2005 17:58:55   
Thanks I'll try it.

(in reply to Spooky)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> upload many files to DataBase
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts