[How-to] [screenshot-basic] Create image upload server and use it with gcphone

Hi there!

I noticed that many people have problems with the correct configuration of screenshot-basic.
Screenshot-basic allows you to take screenshots in the game, and for example send them via gcphone.

1. Download image-server and NodeJS.

At the beginning we have to create an image server. In this case, we will use one of the open-source projects.

image-server

You also need NodeJS, which you can download here:

NodeJS

If you have installed everything, go to the next step.

2. Configure and launch image-server.

In the first step, run command prompt and with the cd command go to the folder where you moved the image-server.

If you are already in this location, run the following command:

npm install

Then rename the config.example.json file to config.json.
If the port indicated in the config is closed, change it to open.

If you have done everything, you can start image-server using the:

node app.js
3. Additionaly step, configure gcphone.

Go to gcphone/static/config/config.json, and complete it as follows:

“enableTakePhoto”: true,
“fileUploadService_Url”: “http://ipadress:3555/upload/”,
“fileUploadService_Field”: “files[]”,

Black photos are common, try to take pictures in the window. If that doesn’t work, reset the screenshot-basic. If you have any problems, write to me.

17 Likes

Nice!

Do you know why im getting this error when i try to take the picture?

https://gyazo.com/61ff9262ee95edd3fde20f99ddaf8a51

Change ipadress to your IP.

2 Likes

Im still getting the same thing https://gyazo.com/262dbbf38c693e45433c914390526e99

Okay so i fixed that issue but now when i send a picture to someone is looks like this (https://gyazo.com/6fb4a83fc3613b10a5e3468279978df9)

but it saves the pictures in the image-server perfectly fine

Check the link to the image in the table phone_messages and check it’s work properly.

This is what i get
https://gyazo.com/9ac001f47a0ee51b955cafdbd8baf33a
Any idea what i could be doing wrong

This is what i get now https://gyazo.com/790e435a9addfe02b36903a93995335d

I’m getting this same issue. Image uploads to the image-server ( not localhost )

Shows blank in gcphone

F8 shows blocked request as you posted for http://localhost:3555/… even though the image was uploaded correctly to the image-server up address.

I did some prints to see where it was incorrect and the screenshot-basic cb in gcphone after uploading prints the localhost, so seems to me like issue with setting up screenshot-basic to send back the upload link not saying localhost.

json. encode ({url = resp. files [ 1 ]. url })

Is returning the localhost:3555/CorrectImageName

1 Like

I got this error:

Could someone please help me! :wink:

Thanks in advance.

Found the ‘issue’ in the image-server config change it from localhost :laughing:

How did you managed to fix that? I already checked image-server config, and changed it from localhost to my ip, and, still says it is blacklisted, could you be that kind to help me please ?
<3 in my db i can easily open it… but in game i cannot

now i have this error Cattura
I did everything as a photo tutorial save in the img-server

this into gcphone config… “//”: “REQUIRE https://github.com/citizenfx/screenshot-basic or set false”,
“enableTakePhoto”: true,
“fileUploadService_Url”: “http://95.141.32.130:3555/upload/”,
“fileUploadService_Field”: “files[]”,

this into img-server
{
“port”: 3555,
“domain”: “http://95.141.32.130:3555
}

img save into server-img folder data/upload

i’m getting the same issue, i don’t know how to solve, we need only the URL but gcphone is sending the entire ToString, but i don’t know how to solve that issue.

so how do you do it? 2 days ago it worked now no :frowning:

solved, just go to image-server -> controllers -> upload.js and replace this function
`static async upload(req, res) {
upload(req, res, async error => {
if (error) {
console.error(error);
return res.json({ message: error.message || String(error) });
}

        const files = [];
        var url = null;
        if (!req.files || !req.files.length) return res.status(400).json({ message: "No files" });

        for (const file of req.files) {
            url= `${config.domain}/${file.filename}`;
        }

        return res.json(url);
    });
}

`

2 Likes

now dont load the real img load only text -.-
salved all img into folder upload
Cattura

I have the same problem as you Nando.
It looks like that the message does not get parsed correctly to show the image. Do we need to install any dependencies?

Need help