Blockland Forums > Modification Help
TCPObject GET requests
<< < (4/10) > >>
Nexus:

--- Quote from: Destiny/Zack0Wack0 on March 09, 2012, 03:45:06 AM ---Your web server is incorrectly serving MIME types and not recognizing the .txt file as a form of plain text, hence it sends it as a binary stream. Not sure why it's giving you an auth error when I can expect the site just fine and all of it's headers seem to be fine. I'm going to guess that it might have to do with the headers Torque is sending it, possibly the Torque user-agent or lack of it.

--- End quote ---

I'm pretty sure that it is forcing it to be a download (not incorrectly recognizing anything), instead of displaying html and text files.
When I tried setting up a ftp server it displayed the text in browser correctly, so it is probably intentional that it is a download instead of display.

Can torque seriously not handle download links? How does it fetch files that don't just display?
Brian Smithers:

function TCPObject::get(%this)
{
   //Example of TCPObject.file: /index.html
   //Example of TCPObject.host: blockland.us:80
   %this.send("GET " @ %this.file @ " HTTP/1.1\r\n");
   %this.send("Host: " @ %this.host @ "\r\n");
   %this.send("Content-Location: " @ %this.file @ "\r\n\r\n");
}

topic
idk
this could help
Destiny/Zack0Wack0:

--- Quote from: Nexus on March 09, 2012, 04:04:58 PM ---I'm pretty sure that it is forcing it to be a download (not incorrectly recognizing anything), instead of displaying html and text files.
When I tried setting up a ftp server it displayed the text in browser correctly, so it is probably intentional that it is a download instead of display.

Can torque seriously not handle download links? How does it fetch files that don't just display?

--- End quote ---
It's something wrong with the MIME type detection. It's not detecting plain text files or it's sending everything as a download (or a octet stream).

It can, the binary buffer thing should have worked. I don't know what's wrong. Try another web server. Or post the exact code you're using to download it.
Nexus:

--- Quote from: Destiny/Zack0Wack0 on March 10, 2012, 01:25:12 AM ---It's something wrong with the MIME type detection. It's not detecting plain text files or it's sending everything as a download (or a octet stream).

It can, the binary buffer thing should have worked. I don't know what's wrong. Try another web server. Or post the exact code you're using to download it.

--- End quote ---

The code I am using is in the OP, and the httpobject code that is getting just an unauthorized error is identical to brians.  What is a binary buffer?  Am I missing some function that would be getting the information otherwise?  I have seen onbitchunk or something in some programs, but I thought that was a custom function or something.  I'll try to look it up and see if adding it helps.
Ipquarx:
Dear god, use the search button.

Look at this topic of mine, it is literally the exact same thing as this topic, and it has a solution.
http://forum.blockland.us/index.php?topic=182981.0

Look at Greek's post, it has THE solution to your quesiton.
Navigation
Message Index
Next page
Previous page

Go to full version