Shadow Uploader - Get files by their corresponding form element name.
Discuss Shadow Uploader - Get files by their corresponding form element name. in the ASP Development forum on ASP Free. Shadow Uploader - Get files by their corresponding form element name. ASP Development forum discussing ASP related topics including coding practices, ASP tips, and more. Active Server Pages (ASP) enables you to empower your HTML pages dynamically with robust scripting options.
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!
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.
Posts: 2
Time spent in forums: 48 m 33 sec
Reputation Power: 0
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.
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.
Posts: 31,109
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.
Posts: 266
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;