Web Hosting Forum | Lunarpages


*
Welcome, Guest. Please login or register.
Did you miss your activation email?



Login with username, password and session length
May 24, 2012, 08:18:05 AM

Pages: [1]   Go Down
  Print  
Author Topic: text file read/write frustration  (Read 365 times)
AstonishingP
Trekkie
**
Offline Offline

Posts: 13


WWW
« on: April 02, 2003, 01:45:00 PM »

I'm trying to make my site easier to update in the future by reading content from a text file.

I've tried using vbscript and javascript and keep on getting errors.

I've been pouring through the Chilisoft documentation to try and figure out what's going on and I haven't had any success.

Can someone help me with this?

I copied the following from Chilisoft to try a simple script out:

 ChiliSoft web page
 
I still get the following error:

Error:  Automation server can't create object

A few times I've gotten this error:

Server object error 'ASP 0177 : 800401f3'

thanks

Duane
Logged
TWebMan
Quantum Encyclopedia Writer
*****
Offline Offline

Posts: 3112



WWW
« Reply #1 on: April 02, 2003, 03:57:00 PM »

Are you sure the file is writeable and in a writeable directory (CHMOD 777)?

Want to use php?  Or are you prefering ASP?  It's pretty easy to read out and write into a file in php, as long as the permissions are set.

I looked at what's at chilisoft and it did look pretty straightforward.
Logged

"Computers cause people to make more mistakes than any other invention in history, with the possible exception of handguns and tequila."  - Unknown
"Liberty of any kind is seldom lost all at once." - D. Hume
Every day is an Ode to Joy
The planet will be fine... and so will your site
stephan
Guest
« Reply #2 on: April 02, 2003, 03:58:00 PM »

I would use PHP

Just rename your page from  .asp/.html (or whatever) to .php

Then put this in where you want the file included:

code:
 <? include ("textfile.txt"); ?> 

Logged
AstonishingP
Trekkie
**
Offline Offline

Posts: 13


WWW
« Reply #3 on: April 02, 2003, 10:19:00 PM »

I need to do it in ASP.

Is the Mars server setup to allow for read/write to text files?

I don't necessarily have to write to a text file, but I do need the permission to read from a text file.  If not, updating my site will not be easy.

I just tried changing the directory permissions to 777 and I get the same errors.

thanks for any help in this matter

Duane
 
 [ April 03, 2003, 07:33 AM: Message edited by: AstonishingP ]
Logged
TWebMan
Quantum Encyclopedia Writer
*****
Offline Offline

Posts: 3112



WWW
« Reply #4 on: April 03, 2003, 02:17:00 PM »

Ok, change the directory back.  You don't need that.  The files you upload will be 644 by default, which is fine.

I tried the simple SSI code below in an asp and an shtml file, and it worked in both of them.  Both files in the root directory of the website (/public_html/).

 
quote:
<!--#include virtual="thisfile.txt"-->

Logged

"Computers cause people to make more mistakes than any other invention in history, with the possible exception of handguns and tequila."  - Unknown
"Liberty of any kind is seldom lost all at once." - D. Hume
Every day is an Ode to Joy
The planet will be fine... and so will your site
AstonishingP
Trekkie
**
Offline Offline

Posts: 13


WWW
« Reply #5 on: April 03, 2003, 03:08:00 PM »

That works great.  The only problem is that it displays the whole text file.

I need to be able to parse the file, looking for certain things, so that I can set certain elements within my page based on the file settings.

That's why I wanted to use the FileSystemObject for reading line by line.

Is it possible to read the SSI into a function and parse the data out that you're looking for?

Am I making this too difficult?    "[Frown]"  

thanks for your help

Duane
 
 [ April 04, 2003, 12:19 AM: Message edited by: AstonishingP ]
Logged
TWebMan
Quantum Encyclopedia Writer
*****
Offline Offline

Posts: 3112



WWW
« Reply #6 on: April 03, 2003, 03:40:00 PM »

If the included file is executable, it should parse.  I call up perl and php stuff all over my websites. So...

What are the conditions?  If you have 5 possibilities, could you use 5 files, each one being the include file under different conditions?  You could make the filename a variable, and then tell asp to write that into the page in the include statement, depending on conditions in an if/else.
Logged

"Computers cause people to make more mistakes than any other invention in history, with the possible exception of handguns and tequila."  - Unknown
"Liberty of any kind is seldom lost all at once." - D. Hume
Every day is an Ode to Joy
The planet will be fine... and so will your site
AstonishingP
Trekkie
**
Offline Offline

Posts: 13


WWW
« Reply #7 on: April 03, 2003, 03:47:00 PM »

I found lots of information on the web about SSI and variable settings.

Lots of reading to do on that with little time to do it in right now.

I think I'll stick with several files for the includes for now like you mentioned.

I still would like to know what the problem was that caused the errors.
Logged
TWebMan
Quantum Encyclopedia Writer
*****
Offline Offline

Posts: 3112



WWW
« Reply #8 on: April 03, 2003, 04:02:00 PM »

Here's what Microsoft came up with.  I don't have time to go through it, but you may well find an answer there.  It wouldn't link so you can just copy and paste.

 http://support.microsoft.com/search/default.aspx?Catalog=LCID%3D1033%26CDID%3DEN-US-KB%26PRODLISTSRC%3DON&Product=&KeywordType=&Titles=false&numDays=&maxResults=25&withinResul ts=&Queryl=ASP+0177%2C++800401f3+&Query=ASP+0177%2C++800401f3+&QuerySource=gsfxSearch_Query
 
 [ April 04, 2003, 01:03 AM: Message edited by: TWebMan ]
Logged

"Computers cause people to make more mistakes than any other invention in history, with the possible exception of handguns and tequila."  - Unknown
"Liberty of any kind is seldom lost all at once." - D. Hume
Every day is an Ode to Joy
The planet will be fine... and so will your site
Pages: [1]   Go Up
  Print  
 
Jump to: