View Single Post
DarkDeviL
SourceMod Moderator
Join Date: Apr 2012
Old 02-15-2021 , 07:22   Re: REST in Pawn 1.2 - HTTP client for JSON REST APIs (Updated 2021/02/07)
Reply With Quote #90

Quote:
Originally Posted by BlackFart View Post
This is the only extension I found for uploading files through http (demos recorded).
Mind if I ask, how are you recording your demos in JPEG?

Quote:
Originally Posted by BlackFart View Post
It doesn't seem like to work for me... (I found cURL, but it's not working for me either... )
Sounds like PICNIC.


Quote:
Originally Posted by BlackFart View Post
Code:
    DirectoryListing  dl = OpenDirectory(newDemoPath);
    char newDemo[256];
    while(dl.GetNext(newDemo, sizeof(newDemo))) {
You're looping through, ... and getting the demo files into the "newDemo" variable?

Quote:
Originally Posted by BlackFart View Post
Code:
        char demoPath[PLATFORM_MAX_PATH];
        BuildPath(Path_SM, demoPath, sizeof(demoPath), "data/image.jpg"); 

        httpClient.UploadFile("upload", demoPath, OnDemoUploaded);
But you're still trying to upload "data/image.jpg" file, which with the BuildPath / Path_SM one would be the file @ "addons/sourcemod/data/image.jpg"?

... Is there any file at all, with the path "addons/sourcemod/data/image.jpg"?


In the end, with no errors, chances are the upload works just fine, and that it is your web url that may not work as expected.

... Is there anything running at all, on localhost, port 8080, and if so, what is the code over there?
__________________
Mostly known as "DarkDeviL".

Dropbox FastDL: Public folder will no longer work after March 15, 2017!
For more info, see the [SRCDS Thread], or the [HLDS Thread].
DarkDeviL is offline