Game Development Community

File Tansfers with HTTP Objects

by Taylor Suchan · in Technical Issues · 10/04/2001 (8:51 am) · 1 replies

Just currious if any one can tell me how to xfer a binary file within the script...

What i am doing is this :
Creating a connection to a web server via an HTTP object, like so:

function GrabFile(%file,%path,%date)
{
%server = "www.domain.com:80";
%serverpath = "/";
%requeststring = "/cgi-bin/app.pl?getfile++" @ %date @ "/" @ %path @ "/" @ %file;

%upd = new SecureHTTPObject(Upgrade)
{
file = %file;
path = "update/"@%path;
};

%upd.post(%server, %serverpath @ %requeststring, "", %upd);

%upd.UpgradeFilehandle = new FileObject();
%upd.UpgradeFilehandle.openForWrite( %path @ "/" @ %file );
}

function Upgrade::onLine( %this, %line )
{
%this.UpgradeFilehandle.writeLine( %line );
}

function Upgrade::connectionTerminated( %this )
{
%file = %this.file;
%path = %this.path;
%thisfile = %path @ "/" @ %file;
%this.UpgradeFilehandle.close();
%this.UpgradeFilehandle.delete();
}
function Upgrade::onDisconnect(%this)
{
%this.connectionTerminated();
}




This works fine and dandy... Problem is if %file is NOT a .CS file or Text file of some sort, seems that its adding line feeds.



P.S> Didnt know if this should go in networking or where...

#1
10/04/2001 (10:18 am)
Tribes2 / Torque does not have binary file capabilities.