Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Including a Text File
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Including a Text File

 Post Reply Post Reply
Author
pmormr View Drop Down
Senior Member
Senior Member


Joined: 06 January 2003
Location: United States
Status: Offline
Points: 1479
Post Options Post Options   Thanks (0) Thanks(0)   Quote pmormr Quote  Post ReplyReply Direct Link To This Post Topic: Including a Text File
    Posted: 01 May 2003 at 6:26pm

I've talked about this before, but when i tried the advice i was given it doesn't work. I was told that this would work

Server.Execute("/myfolder/"&myvariable)

I need to print the contents of a text file (ext. .txt written in notepad) onto my page. The only catch is that the filename is contained in a variable. The statement before doesn't work. Can anyone help?



Edited by pmormr
Back to Top
MorningZ View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
Post Options Post Options   Thanks (0) Thanks(0)   Quote MorningZ Quote  Post ReplyReply Direct Link To This Post Posted: 01 May 2003 at 8:39pm

"doesnt work"

care to explain that in more detail?  (did it give an error?  did it just spit out nothing? did you reponse.write whats inside the statement and verify it does indeed exist?)

Contribute to the working anarchy we fondly call the Internet
Back to Top
pmormr View Drop Down
Senior Member
Senior Member


Joined: 06 January 2003
Location: United States
Status: Offline
Points: 1479
Post Options Post Options   Thanks (0) Thanks(0)   Quote pmormr Quote  Post ReplyReply Direct Link To This Post Posted: 02 May 2003 at 5:37pm

Sorry about that, i was in a bit of a rush. Here's the error it gives me.

Server object error 'ASP 0228 : 80004005'

Server.Execute Error

/_stuff/_jokes/joke_display.asp, line 32

The call to Server.Execute failed while loading the page.

no clue what that means. The line prints exactly how i want it.
Server.Execute("/_jokestorage/fiftyfifty.txt")

i would like to try to get this way to work instead of using file system object to print the contents of the file. If there is no other way then i'll use file system object

Back to Top
MorningZ View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
Post Options Post Options   Thanks (0) Thanks(0)   Quote MorningZ Quote  Post ReplyReply Direct Link To This Post Posted: 02 May 2003 at 6:14pm

two things to try

1) Goto http://www.whateveryourdomainis.com/_jokestorage/fiftyfifty.txt and see if it is even loadable by a browser
If you get a "404" error then you have the path wrong (fix it), if you get a "403" error, then its not browsable (use FSO to read and spit out)

Then
2) Try using the extension ".inc" instead as maybe the server is getting confused with the text (this #2 is a reach and i dont think its a solution)

Contribute to the working anarchy we fondly call the Internet
Back to Top
pmormr View Drop Down
Senior Member
Senior Member


Joined: 06 January 2003
Location: United States
Status: Offline
Points: 1479
Post Options Post Options   Thanks (0) Thanks(0)   Quote pmormr Quote  Post ReplyReply Direct Link To This Post Posted: 02 May 2003 at 6:36pm
its browsable. I'm still not sure what happening. It's probably some stupid error that i'm overlooking. thanks for your help
Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post Posted: 02 May 2003 at 9:43pm
where is the file relativ to your calling page? if I remeber right, if you got a leading slash "/" then it starts from the root. So if you describe relative path take the / out and try.
Back to Top
pmormr View Drop Down
Senior Member
Senior Member


Joined: 06 January 2003
Location: United States
Status: Offline
Points: 1479
Post Options Post Options   Thanks (0) Thanks(0)   Quote pmormr Quote  Post ReplyReply Direct Link To This Post Posted: 03 May 2003 at 10:50am
thats the ticket! thanks.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.