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.








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  Re: Print and print preview file on the website without using the File - Print on the IE
•  Re: ASP.NET web controls
•  Re: JavaSript Problem In Mac Safari Browser
•  Re: DHTML div positionning Problem
•  Convert script to NS6 compatible - Please Help!
•  Print .doc file from the website using System.Diagnostics.Process
•  Re: Fullscreen code
•  Re: iframe targeting
•  Excel n ASP


Recent Articles
Communicating with the Database (Using ADO)
MagicGrid
Simple Thumbnail Browsing Solution
Type Anywhere
A Better Moustrap: FmtDate to replace FormatDateTime
ASP.NET Forum Source Code
Internal Search Engine
Javascript Growing Window
Simple date validation
Search engine friendly URLs using ASP.NET (C#.NET)


Site Survey
Help us serve you better. Take a five minute survey. Click here!

© Copyright codetoad.com 2001-2005