ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingASP Development
ASP Free and Iron Speed Designer are giving away $5,500+ in FREE licenses. Iron Speed's RAD CASE toolset can save up to 80% of your coding time. One free license per week, one perpetual license per month!

Download and Activate to enter!
Receive the tools necessary to be the rock star of your field. Our 12-month program teaches you the evolving world of multi-channel marketing as well as the complex issues and opportunities found in the industry.
Web development can be a daunting task, even for specialists. There is a lot of information to absorb and a lot of technologies to learn in order to manage a superior website. When trying to learn the ropes, developers need a reliable source to introduce new ideas that can be easily implemented. When working on large projects, even web veterans may run into a technology or an aspect of a technology that they are unfamiliar with.

Download to Enter | Contest Rules

Learn More!

Tutorials | Forums

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old May 14th, 2007, 02:30 AM
abuzaineh abuzaineh is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2007
Posts: 2 abuzaineh User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 48 m 33 sec
Reputation Power: 0
Exclamation Save fieldssing name not index

how I can save filed to disk using file name
if I have Image1 , imange2

I want to save files using:
objUpload("Image1").SaveToDisk Path, Newfile_name1
objUpload("Image2").SaveToDisk Path, Newfile_name2
I am traying that but an error appear

I need that because some time I have more than one different file

Last edited by Shadow Wizard : May 16th, 2007 at 03:10 AM.

Reply With Quote
  #2  
Old May 14th, 2007, 03:07 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
Click here for more information
 
Join Date: Sep 2004
Location: Israel
Posts: 31,109 Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)  Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6
Time spent in forums: 3 Months 3 Weeks 2 Days 20 h 18 m 8 sec
Reputation Power: 2919
(regarding this thread)

Quote:
Originally Posted by abuzaineh
how I can save filed to disk using file name
if I have Image1 , imange2

I want to save files using:
objUpload("Image1").SaveToDisk Path, Newfile_name1
objUpload("Image2").SaveToDisk Path, Newfile_name2
I am traying that but an error appear

I need that because some time I have more than one different file
hello and welcome to the forum!
currently my script does not support such thing.
as work around, add this function to your existing code:
Code:
Function GetFileIndexByName(objUpload, strName)
	Dim x, curName, strToSearch
	If objUpload(strName)="" Then
		GetFileIndexByName = -2
		Exit Function
	End If
	For x=0 To objUpload.FileCount-1
		curName = LCase(objUpload.File(x).FileName)
		strToSearch = "\" & curName
		If Right(LCase(objUpload(strName)), Len(strToSearch))=strToSearch Then
			GetFileIndexByName = x
			Exit Function
		End If
	Next
	GetFileIndexByName = -1
End Function

then, have such code to save file according to the name of the file input
it came from:
Code:
	Response.Write("found "&objUpload.FileCount&" files...<br />")
	Response.Write("saving file2 only:<br />")
	fileIndex = GetFileIndexByName(objUpload, "file2")
	If fileIndex>=0 Then
		Call objUpload.File(fileIndex).SaveToDisk( Server.MapPath("Uploads"), "" )
		Response.Write("the file " & objUpload.File(fileIndex).FileName & " has been saved.")
	Else  
		Response.Write("no file")
	End If

hope this is clear enough, let me know how it goes.

Last edited by Shadow Wizard : May 16th, 2007 at 03:10 AM.

Reply With Quote
  #3  
Old May 14th, 2007, 05:50 AM
abuzaineh abuzaineh is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2007
Posts: 2 abuzaineh User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 48 m 33 sec
Reputation Power: 0
Thanks ... it's work

ok
it's work
you are perfect MAN
BIG Thanks For YOU

Reply With Quote
  #4  
Old May 14th, 2007, 06:01 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
Click here for more information
 
Join Date: Sep 2004
Location: Israel
Posts: 31,109 Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)  Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6
Time spent in forums: 3 Months 3 Weeks 2 Days 20 h 18 m 8 sec
Reputation Power: 2919
Quote:
Originally Posted by abuzaineh
ok
it's work
you are perfect MAN
BIG Thanks For YOU
cheers man, I will integrate this in the main code when I'll have some time.
you're welcome to stay in our little forum, you'll find bunch of pretty
friendly people in the Lounge for example.

Reply With Quote
  #5  
Old December 17th, 2007, 09:28 AM
flywolf flywolf is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2007
Posts: 2 flywolf User rank is Private First Class (20 - 50 Reputation Level)flywolf User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 15 m 21 sec
Reputation Power: 0
Hi all!
This code doesn' work under Fire Fox
Always return -1

Reply With Quote
  #6  
Old December 17th, 2007, 09:41 AM
flywolf flywolf is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2007
Posts: 2 flywolf User rank is Private First Class (20 - 50 Reputation Level)flywolf User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 15 m 21 sec
Reputation Power: 0
I have change string
Code:
strToSearch = "\" & curName

to
Code:
strToSearch = curName


Now it work in FF and in IE.
Comments on this post
Dr_Rock agrees: yep, your right

Reply With Quote
  #7  
Old May 7th, 2008, 10:58 AM
foreverforever foreverforever is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2008
Posts: 266 foreverforever User rank is Major (30000 - 40000 Reputation Level)foreverforever User rank is Major (30000 - 40000 Reputation Level)foreverforever User rank is Major (30000 - 40000 Reputation Level)foreverforever User rank is Major (30000 - 40000 Reputation Level)foreverforever User rank is Major (30000 - 40000 Reputation Level)foreverforever User rank is Major (30000 - 40000 Reputation Level)foreverforever User rank is Major (30000 - 40000 Reputation Level)foreverforever User rank is Major (30000 - 40000 Reputation Level)foreverforever User rank is Major (30000 - 40000 Reputation Level)foreverforever User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 5 Days 21 h 12 m 45 sec
Reputation Power: 338
Naming images as "listing_id-#"

Firstly, Mr Shadow - I could write an essay and not adequately convey how chuffed I am with your uploader, so please simply accept a big thank you - it's fantastic.

Secondly, in case anyone else wanted to save their images as I do, I offer the following, in the hope that it's of some help to somebody.

The images that I want to upload relate to listings, with users being able to upload up to 8 images per listing.

I want to save the images on the server using the listing_id as the first part of the image name, and the image number (e.g. 1,2,3 etc) forming the second part of the image name, with a dash between the two parts.

For example, the images for listing 12345 would be uploaded as 12345-1.ext, 12345-2.ext, 12345-3.ext, etc, etc, etc

To do this, I added a hidden field "listing_id" (giving it a dynamic value of the listing_id) to the form, and replaced the following line of code;

Code:
Else   Call objUpload.File(x).SaveToDisk(Server.MapPath("Uploads"), "")


with this;

Code:
Else   Call objUpload.File(x).SaveToDisk(Server.MapPath("Uploads"),(objUpload("listing_id") & "-" & (x+1)))


I am not sufficiently experienced to know if it's technically the right thing to do, but it seems to work.

Hope it helps.

Reply With Quote
  #8  
Old May 9th, 2008, 03:36 AM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
Click here for more information
 
Join Date: Sep 2004
Location: Israel
Posts: 31,109 Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 29th Grade (Above 100000 Reputation Level)  Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6Folding Points: 2595929 Folding Title: Super Ultimate Folder - Level 6
Time spent in forums: 3 Months 3 Weeks 2 Days 20 h 18 m 8 sec
Reputation Power: 2919
yes that's pretty much correct - cheers for this, and thanks for sharing!

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingASP Development > Shadow Uploader - Get files by their corresponding form element name.


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 



Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.

© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 6 - Follow our Sitemap