Openfile with http url?

BlitzMax Forums/BlitzMax Beginners Area/Openfile with http url?

jondecker76(Posted 2005) [#1]
Hello. I'm starting to dive into max but can't get some simple things to work.. I'm trying to fetch an http based url but openfile returns nothing. Here is a simple example (maybe i'm missing an include or something??)
video = OpenFile("http://www.blitzmax.com/img/brllogo-thin.png",True,False)

If Not video Then Print "could not open"

End


What am I doing wrong?

thanks


FlameDuck(Posted 2005) [#2]
I'm not sure you can do what you seem to be wanting to do. You see http connections (and indeed most network based connections) are streaming connections. That is there is no way to seek, or request a particular part of the file. You simply have to read it from start to finish.

If you're trying to do what I think you're trying to do, I would suggest you load it into a bank first.


teamonkey(Posted 2005) [#3]
FlameDuck: It says you can in the docs. In fact, it says that OpenFile/ReadFile caches http streams so you can seak within them.

But I can't get it to work using http urls either. It's not even attempting to make the connection because my firewall doesn't flash up a confirmation box. This is Windows Max v1.03.

[EDIT] Of course had I read further into the docs I would have seen what I'm doing wrong. You have to use a double colon, like this:
video = OpenFile("http::www.blitzmax.com/img/brllogo-thin.png",True,False)

If Not video Then Print "could not open"

End



FlameDuck(Posted 2005) [#4]
In fact, it says that OpenFile/ReadFile caches http streams so you can seak within them.
Really? That's pretty clever! Unless you're accessing a CD's worth or something...


taxlerendiosk(Posted 2005) [#5]
try
http::www.blitzmax.com/img/brllogo-thin.png



jondecker76(Posted 2005) [#6]
thanks a lot guys.. Works fine now. Kind of goofy, but hey, it works!