Jump to content
DcrClub

Has anyone used the File method? About HTTP download files.

Recommended Posts

Why using the File method to request a network file address will only return a errorcode = 5. header is set "application/octet-stream".

 

However, the successful file cannot be downloaded locally.

Share this post


Link to post
Share on other sites
1 hour ago, DcrClub said:

Why using the File method to request a network file address will only return a errorcode = 5. header is set "application/octet-stream".

 

However, the successful file cannot be downloaded locally.

Because.

Actually game has RestApi and it's considered only for uploading data to Webserver. Not important what's method did you selected Get, Post or file, not matter what's header type you had setted up and what's kind of data did you submitted you will get ErrorCode 8 on success.

So you shall dig to RestApi.c file and while you'll digging it you'll find the brief part of ANY submit type (GET/POST/FILE):

"Pushes {type} request and return result (ERestResultState) and/ or data (timeout, error) when finished".

That means whe you get in your callback OnError with code 8, data was submitted and received by server, maybe issue is hidden by the method of termination of the connection, on PHP i prefer end the script with die();  //kills PHP script. And that unexpected termination (for the RestApi) causes this error, but i don't know never had tryed with other ways.

So I suggest you to try other ways for server-side script termination (on receiver side) idk PHP, Python or whatever do you use for soft termination of connection and that may help you to finalize without error code 8.

If you got luck may you share your result please because it's interesting for me too.

 

With my regards.

Share this post


Link to post
Share on other sites
15 hours ago, Sid Debian said:

Because.

Actually game has RestApi and it's considered only for uploading data to Webserver. Not important what's method did you selected Get, Post or file, not matter what's header type you had setted up and what's kind of data did you submitted you will get ErrorCode 8 on success.

So you shall dig to RestApi.c file and while you'll digging it you'll find the brief part of ANY submit type (GET/POST/FILE):

"Pushes {type} request and return result (ERestResultState) and/ or data (timeout, error) when finished".

That means whe you get in your callback OnError with code 8, data was submitted and received by server, maybe issue is hidden by the method of termination of the connection, on PHP i prefer end the script with die();  //kills PHP script. And that unexpected termination (for the RestApi) causes this error, but i don't know never had tryed with other ways.

So I suggest you to try other ways for server-side script termination (on receiver side) idk PHP, Python or whatever do you use for soft termination of connection and that may help you to finalize without error code 8.

If you got luck may you share your result please because it's interesting for me too.

 

With my regards.

If get is not a data stream, only string will be returned, and file cannot download files. this API design is really chicken ribs.

    override void OnSuccess( string data, int dataSize )

    {

        Print( "Request successful => data length: " + dataSize );

        for( int i = 0; i < data.Length(); i++ )

        {

            Print( data );

        }

    };

SCRIPT       : Request successful => data length: 174377
SCRIPT       : �
SCRIPT       : P
SCRIPT       : N
SCRIPT       : G
SCRIPT       :

SCRIPT       :
SCRIPT       : 
SCRIPT       :
SCRIPT       : m_LoginTimeMs: 6200
SCRIPT       : ---- PlayerBase OnStoreLoad SUCCESS ----

Share this post


Link to post
Share on other sites
9 minutes ago, DcrClub said:

If get is not a data stream, only string will be returned, and file cannot download files. this API design is really chicken ribs.

    override void OnSuccess( string data, int dataSize )

    {

        Print( "Request successful => data length: " + dataSize );

        for( int i = 0; i < data.Length(); i++ )

        {

            Print( data );

        }

    };

SCRIPT       : Request successful => data length: 174377
SCRIPT       : �
SCRIPT       : P
SCRIPT       : N
SCRIPT       : G
SCRIPT       :

SCRIPT       :
SCRIPT       : 
SCRIPT       :
SCRIPT       : m_LoginTimeMs: 6200
SCRIPT       : ---- PlayerBase OnStoreLoad SUCCESS ----

It was made for uploading (data, idk for logs uploading to python/PHP backend or something else useful) and not meant to use as downloader (that's about viruses and other bad stuff). Can you imagine how many server's would be filled with viruses from annoying ads up to cryptominers and different backdoors?

Share this post


Link to post
Share on other sites
40 minutes ago, Sid Debian said:

It was made for uploading (data, idk for logs uploading to python/PHP backend or something else useful) and not meant to use as downloader (that's about viruses and other bad stuff). Can you imagine how many server's would be filled with viruses from annoying ads up to cryptominers and different backdoors?

Dayz mod has no execution permission. 

Can't download files, can't let me dynamically update UI

Share this post


Link to post
Share on other sites
35 minutes ago, DcrClub said:

Dayz mod has no execution permission. 

Can't download files, can't let me dynamically update UI

Did you ever tryed to execute command prompt with admin rights on windows 10/11 through cmd and guest account? I did and want to say it's nothing hard. Still no way to resolve it (or MS not really willing to do so). So explain me an interesting stuff why shall devs of the game shall give anyone ability to download anonymous file? You willing to make the potential virus hall out of the game?

Windows as operation system is the awesomest hall of security without any kind of seriously protection (yeah let's remember the BitLocker another useful feature by MS).

How do you think will BI fall so hard to get 'eir face into the crp so hardly? That's why you can't download from the game and that's why still there's no open DLL system (like in arma2 & 3 aka RVextension), because it's huge security risk for the system.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×