writing to a .txt file online

BlitzMax Forums/BlitzMax Beginners Area/writing to a .txt file online

jkrankie(Posted 2005) [#1]
I've been messing around with streams and i can't write to a .txt file i put on my webspace. Why cant i do this, or am i missing something silly.

Local array1:String[10]
Local array2:String[10]

in=ReadStream("http::c-knight.madasafish.com/CG_01/hiscore.txt")

If Not in RuntimeError "Failed to open a ReadStream to file http::www.blitzbasic.com"

'While Not Eof(in)
	For i=0To 9
	array1[i]=ReadLine(in)
	array1[i]=ReadLine(in)
	Next
CloseStream in

in=WriteStream("http::c-knight.madasafish.com/CG_01/hiscore.txt")	
	For i=0 To 9
		WriteLine in,Array1[i]+"monkey"
		WriteLine in,Array2[i]+"monkey"
	Next

'Wend
CloseStream in

in=ReadStream("http::c-knight.madasafish.com/CG_01/hiscore.txt")

If Not in RuntimeError "Failed to open a ReadStream to file http::www.blitzbasic.com"

'While Not Eof(in)
	For i=0To 9
	array1[i]=ReadLine(in)
	array1[i]=ReadLine(in)
	Next
CloseStream in



cheers
charlie


jkrankie(Posted 2005) [#2]
Anyone? or is this not possible?

cheers
charlie


FlameDuck(Posted 2005) [#3]
Anyone? or is this not possible?
Not exactly, no.


skn3(Posted 2005) [#4]
You will need to do it via a php/asp script. Pass some data to the script and have the script write that data to your textfile.

Either that or connect via ftp and upload the textfile.

There are no direct ways to do what you are asking though.


jkrankie(Posted 2005) [#5]
How would i connect via FTP then? I found no ftp commands in the docs.

cheers
charlie


skn3(Posted 2005) [#6]
You would have to write some ftp commands, or convert the ftp commands in the code archives to blitzmax.

http://www.blitzbasic.com/codearcs/codearcs.php?code=16