Parsing out HTML files from ASP

Results 1 to 3 of 3

Thread: Parsing out HTML files from ASP

  1. #1
    Norman King Guest

    Default Parsing out HTML files from ASP

    I can create an Active Server Page that reads in an HTML file using the File System Object, as long as it is a file on the Server Hard Drive, but I cannot do the same thing for a file elsewhere like via the http protocol.<BR><BR>For example:<BR><BR>&#060;%<BR>Set fs_Resume = CreateObject("Scripting.FileSystemObject")<BR><BR> On Error Resume Next<BR><BR>If UCase(Left("" & gs_Resume,4)) = "HTTP" Then<BR> Set gs_Text = fs_Resume.OpenTextFile(gs_Resume, 1, false, 0)<BR>Else<BR> Set gs_Text = fs_Resume.OpenTextFile("c:inetpub croot chome" & gs_Resume, 1, false, 0)<BR>End If<BR><BR>If Err.Number &#060;> 0 Then<BR> response.write "&#060;center>&#060;b>&#060;font face=&#039arial&#039 color=&#039red&#039>Resume Not Found&#060;/b>&#060;/font>&#060;/center>"<BR>Else<BR><BR> Do While Not gs_Text.AtEndOfStream<BR> gs_Temp = gs_Text.ReadLine<BR><BR> Response.write gs_Temp & chr(13) & chr(10)<BR><BR> Loop<BR><BR><BR> gs_Text.Close<BR>End If<BR>&#037;&#062;<BR><BR>I would be displaying somebody&#039s resume, if it exists on the server, it works. However, if I have gs_resume set to http://www.whatever.com/~nking/resume.html it will not open it even if the file exists. I am guessing that the File System Object is limited to just the drives on the server?<BR><BR>Is there anyway I can read in a HTML file from some web server and then parse it out? I am reading these values from a database, and then calling the ASP Page to display the person&#039s resume. It only works if the file is on the C: drive or another drive mapped by the server.

  2. #2
    Join Date
    Dec 1969
    Posts
    2,849

    Default RE: Parsing out HTML files from ASP

    Yes, the FileSystemObject (or FSO) is limited to local files. There is a third party component from SeverObjects that allows you to grab stuff off other web servers using a fully qualified URL. It is called AspHttp (http://www.serverobjects.com/products.htm#Asphttp) but is not free! ($49.95 and up...)<BR><BR>There&#039s a free version of a similar package mentioned at this URL: http://www.activeserverpages.com/components/asptear.asp (supposedly free)<BR><BR>To surmize, you cannot use FSO, you have to use a third party component. Good luck!

  3. #3
    Norman King Guest

    Default RE: Parsing out HTML files from ASP

    Thanks, I was hoping that Microsoft had something built in for that, or that I could use XML or something. <BR><BR>The Free Component doesn&#039t appear to do anything when I browse to it at http://www.activeserverpages.com/components/asptear.asp it just shows a blank page. What gives?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •