codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  help with reading files  arasaki1 at 17:07 on Friday, April 02, 2004
 

I am new to ASP scripting...I am switching to a windows server, and had some perl scripts on linux, which could read files on the server and display the .pdf within as links. How can i do that with asp?

Any help would be greatly appreciated.

-Thank you-

  Re: help with reading files  Troy Wolf at 20:49 on Friday, April 02, 2004
 

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/jsobjfile.asp
These pages from Microsoft's MSDN will give you all the help you need including plenty of VBScript code snippets. One thing to note, the VBScript examples are not ASP specific. To make them ASP specific, you have to change the object instantiation line from this:

Set fso = CreateObject("Scripting.FileSystemObject")


To this:

Set fso = Server.CreateObject("Scripting.FileSystemObject")


Here is an example from http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/jsprofiles.asp?frame=true that will probably be all you need to get your job done.

Function ShowFileList(folderspec)
Dim fso, f, f1, fc, s
Set fso = Server.CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFolder(folderspec)
Set fc = f.Files
For Each f1 in fc
s = s & f1.name
s = s & "<BR>"
Next
ShowFileList = s
End Function
Troy Wolf: site expert
Shiny Solutions


  Re: help with reading files  arasaki1 at 21:00 on Friday, April 02, 2004
 

Thank You, I will give it a try and see what happens.

Thanks Again.



© Copyright codetoad.com 2001-2005