Blitz doesn't like downloading PHP files

Blitz3D Forums/Blitz3D Programming/Blitz doesn't like downloading PHP files

bytecode77(Posted 2008) [#1]
i was able to download html and other files, but NOT php files. maybe it is because of the php runtime, which causes a TCP timeout.

i don't quite know which code to go for, but here are both:

first:
	WriteLine tcp, "GET " + path$ + filename$ + " HTTP/1.1"
	WriteLine tcp, "Host: " + host$
	WriteLine tcp, "User-Agent: test"
	WriteLine tcp, "Accept: */*"
	WriteLine tcp, ""

second:
	eol$ = Chr(13) + Chr(10)
	WriteLine tcp, "GET " + path$ + filename$ + " HTTP/1.1 " + eol$ + "Host: " + host$ + eol$ + "User-Agent: test" + eol$ + "Accept: */*" + eol$


edit: forgot to add, but both are not working. i had this problem before. this time it doesnt work at all, but previously it was working randomly if you know what i mean...


bytecode77(Posted 2008) [#2]
newsflash: PHP and CSS files cant be downloaded. the reason for that is that i don't get a "Content-Lenght:" when reading the tcp stream...

thats how a normal header looks like:
HTTP/1.1 200 OK
Date: Sun, 04 May 2008 14:18:40 GMT
Server: Apache/2.2.3 (Debian) mod_ssl/2.2.3 OpenSSL/0.9.8c
Last-Modified: Sat, 01 Mar 2008 08:17:11 GMT
ETag: "15acb85-1b46-4475bc8110fc0"
Accept-Ranges: bytes
Content-Length: 6982
Connection: close
Content-Type: text/html; charset=none
Content-Language: de


thats how a header of a php/css file looks like:
HTTP/1.1 200 OK
Date: Sun, 04 May 2008 14:18:40 GMT
Server: Apache/2.2.3 (Debian) mod_ssl/2.2.3 OpenSSL/0.9.8c
X-Powered-By: PHP/5.2.5-0.dotdeb.2
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html; charset=none
Content-Language: de
see, i do NOT get a __Content-Lenght__ information, so i can't download anything :(


Panno(Posted 2008) [#3]
i try it yesterday with the same "Error" .
its your own server then write a php script what sends your
the file


bytecode77(Posted 2008) [#4]
it seems to be a general problem. i cant seem to download php/css files at all... i just don't get that "Content-Lenght:" information in the header, which is most important!


Koriolis(Posted 2008) [#5]
This is because you have this:
Transfer-Encoding: chunked
This basically means that the trasnfer will be made as a series of distinct blocks.
See this: http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.6.1


bytecode77(Posted 2008) [#6]
i'll work at this and will come back soon.
edit:WOW i got it! and since i learned from here how to download fast, i download a complete chunk at once and it is pretty fast, too.
thank you so much :)