Jump to content

FileOpen remote file


Recommended Posts

I recently wrote a large program the reference variables from a txt file. It works fine but was want to have the txt file instead of being the the same dir as the script, instead me on mysite and reference it from there. Before i used

$color = FileOpen("color.txt", 0)

I thought this might work

$color = FileOpen("http://mysite.com/color.txt", 0)

Since anyone could see it and it worked in my web-browser. However non of the variables now work and im thinking its not actually opening the file because the location. Is there another command i use before FileOpen, like a HTTP base one or something? Help didn't seem to help too much, i assume its because i don't know where to look

muppet hands are so soft :)

Link to comment
Share on other sites

$color1 = InetRead ("http://mywebsite/color.txt", 1)

$color= BinaryToString($color1)


$test = FileReadLine ($color, 3)
$test = StringTrimLeft($test,13)

MsgBox (1,"title", $test)

That works if i tell the msgbox to give $color but not if i use the line read and trim. Any suggestions?

muppet hands are so soft :)

Link to comment
Share on other sites

well that successfully writes it to the console but i have around 300 line in the script that look like this

$test = FileReadLine ($color, 3)
$test = StringTrimLeft($test,13)

Is there a way to convert it to a temp file so all the trims and read line matchup?

Edited by russell

muppet hands are so soft :)

Link to comment
Share on other sites

You could also use:

$sFileRead = BinaryToString(InetRead ($sURL))

This would avoid the temp file.

Dating a girl is just like writing software. Everything's going to work just fine in the testing lab (dating), but as soon as you have contract with a customer (marriage), then your program (life) is going to be facing new situations you never expected. You'll be forced to patch the code (admit you're wrong) and then the code (wife) will just end up all bloated and unmaintainable in the end.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...