CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 List files in a folder (FSO)

Print topic Send  topic

Author Message
Sean

Posts: 39
Posted: 11/18/2004, 6:46 AM

I am trying to display all .TIF files listed in a specific folder, but I am having a small problem.

My Test Code
---------------------------------------
<%
dim fs,fo,x

set fs=Server.CreateObject("Scripting.FileSystemObject")
set fo=fs.GetFolder("c:\test\")
for each x in fo.files
Label2.value = x.Name & "<br />"
next
set fo=nothing
set fs=nothing
%>
----------------------------------------

This code only seems to list the very last file in the directory instead of all of them. I want it associated with a label so I can put it in an iframe.

Any assistance would be appreciated.
View profile  Send private message
mrachow


Posts: 509
Posted: 11/18/2004, 7:07 AM

Hi Sean,

I suppose you have one label control only so its value will be overridden only the last file names stays.

Your technique would work inside an BeforeShowRow event of a grid.
Here the name of the control can be used the subsequently fill every line of the grid.
Showing your images with a grid you are able to use one control but you have to provide the next imageby yourself .

Or do you would like to say
Label2.value = Label2.value & x.Name & "<br />"

Regards,
Michael

_________________
Best regards,
Michael
View profile  Send private message
Sean

Posts: 39
Posted: 11/18/2004, 9:07 AM

hmm....

Any other suggestions? I still can't get it to work :(
View profile  Send private message
peterr


Posts: 5971
Posted: 11/19/2004, 12:30 AM

May I ask what is the problem after you make the change proposed by Michael?
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
Sean

Posts: 39
Posted: 11/19/2004, 6:38 PM

Quote peterr:
May I ask what is the problem after you make the change proposed by Michael?

I didn't get any files listed. I kept getting No Records. But, I got it to work the way I want by using my first method and putting it in an iFrame.

The reason I wanted to put it into a grid is so I could control where on the page the results displayed. The iFrame fixed that. If you know of how to do it in a grid fashion, I would love to see for future use.

Thanks.
Sean
View profile  Send private message
peterr


Posts: 5971
Posted: 11/19/2004, 7:45 PM

Sorry, but I don't find it possible that your previous code listed only the last file, but now with Michael's modification it suddenly stopped showing any records, not even the last one as previously.
The only change was to add "Label2.value & " to the code.
Are we misundesrtanding something? How did you get it to list the last file the 1st time? And how is "No Records" related to all this, since your code doesn't include the text "No Records"?

I'd like to help if I can understand the issue.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
Sean

Posts: 39
Posted: 02/18/2005, 8:05 AM

Sorry Peter, but I got distracted and got pulled off onto other projects, but now I am needing to revisit this issue.

Ok, here's what I am trying to accomplish:
---------------------------------------------------------
I am trying to build a file manager. I want to display a list of folders/files in a grid form with alternating colors. I want the contents of a path to display in this grid in it's own row (so I can add additional fuctionality like checkboxes, dropdown, etc).

Problem:
---------------------------------------------------------
When I create a blank grid and assign a label the following code, it doesn't show any records. When I create a connection to a database, it then shows the files, but the entire contents of the directory show up in each row (it repeats).

Code:
---------------------------------------------------------
dim fs,fo,x

set fs=Server.CreateObject("Scripting.FileSystemObject")
set fo=fs.GetFolder("E:\FaxOrders\")
for each x in fo.files
Label1.value = Label1.value & x.Name & "<br />"

next
set fo=nothing
set fs=nothing
---------------------------------------------------------

Is what I am trying to accomplish possible using CodeCharge's grid? Or do I have to write my own HTML to build my own?

Please help. I will provide as much information as necessary.

Thanks,
Sean
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.