Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Professional
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 15th, 2014, 09:24 PM
Friend of Wrox
Points: 6,664, Level: 34
Points: 6,664, Level: 34 Points: 6,664, Level: 34 Points: 6,664, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2004
Location: Sydney, NSW, Australia.
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default Loop through a single form control collection while uploading file

I remember this issue from a while ago. I never solved it then and now its hitting me in the face again. The code I have inherited uses SoftArtisans.FileUp to upload files. There is a migration and the new requirement is to use Persits.Upload. EG:

Code:
set xyz = Server.CreateObject("Persits.Upload")
In short the page form has two multi line select areas and a file upload. The processing page needs to loop through the number of items which have been selected multi line select area. So using SoftArtisans.FileUp this works:

Code:
'for i = 1 to upl.formex("fieldName").Count
   somevariable = upl.formex("fieldName")(a)
   sql = "..do something with variable..."
Next
but after changing this to use "Persits.Upload" I have unfortunately remembered that it does not have a Count property. I can not figure out any way to fire a loop based on the number of items the user has selected. Form what I can figure only the first selection is available when using Persits.Upload. EG this shows me the first selection :

Code:
response.write upl.form("fieldName")
Is there any way to access the collection of values which the user has selected in a single multi line select area??? Here is the first line of the FOR loops that I have tried, all fail:

Code:
for i = 1 to upl.form("fieldName").Count

for a = 1 to uBound(upl.form("fieldName"))
I have searched the Persits.Upload website, there no mention of this. The only loop example they give is when multiple files are being uploaded. Surely there is a way????? Help...
__________________
Wind is your friend
Matt

Last edited by mat41; January 15th, 2014 at 09:46 PM..
Reply With Quote
  #2 (permalink)  
Old January 16th, 2014, 05:59 AM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Can't you just loop over upload.Form as described here: http://www.aspupload.com/object_upload.html#Form and check the keys?

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
Reply With Quote
  #3 (permalink)  
Old January 16th, 2014, 03:24 PM
Friend of Wrox
Points: 6,664, Level: 34
Points: 6,664, Level: 34 Points: 6,664, Level: 34 Points: 6,664, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2004
Location: Sydney, NSW, Australia.
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

Hi Imar. I had not found this when I posted. I did find it before the end of the day however it didn't work for me......Anyhow, a new day now and it does work. The solution is
Code:
For Each Item in upl.Form
   If Item.name = "fieldName" Then
      'and now use Item.name
    End If
Next
Thanking you
__________________
Wind is your friend
Matt
Reply With Quote
  #4 (permalink)  
Old January 17th, 2014, 03:44 AM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Quote:
Anyhow, a new day now and it does work.
That's what new days tend to do ;-) Glad to hear it's working.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Bulk uploading a large xml file into single column in table arul1984 SQL Server 2000 1 March 13th, 2009 05:15 AM
uploading file to a remote IP using upload control abhishekkashyap27 C# 2005 4 June 27th, 2008 07:50 AM
Loop through form looking for Combo Control feets Access VBA 3 November 20th, 2007 09:17 AM
Collection-based for loop troubles... stidle BOOK: Beginning Java 2, JDK 5 Edition 0 February 13th, 2006 08:52 PM
Sending Form Collection To *base.cs file bsausser ASP.NET 1.0 and 1.1 Basics 11 February 12th, 2004 03:42 PM



All times are GMT -4. The time now is 02:49 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.