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

Try it without the /D

Not working with localhost or 127.0.0.1. Try using ngrok on HTTP 3555

1 Like

How can i run a node.js in zap?

how to install that on an server ? :slight_smile:

did you solve it?

does someone know how to install it on a Linuxserver?

404 does mean that the image that he is searching could not be found

same here

what gcphone is this? Can you share the link ty in advance <3

To solve this proble use res.send

> 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 = '';
> 
>             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.send(url);
>         });
>     }
1 Like

how do i run image -server on node js

do you need help?

Hello, the problem that I have, I have everything fine, but when I take the captures it comes out in black I have looked at everything but I do not see the error

I get this message in F8
How can i fix it?

1 Like

Hello, i have problem with server on windows server
ports are unlocked, when i test http://ip:3555/upload in webbrowster it shows error
‘Error: ENOENT: no such file or directory, stat ‘C:\IMAGE_SERVER\image-server\data\uploads\upload’’
-> so it works

ill tried to debug with

RegisterCommand('screen', function(source, args)
	exports['screenshot-basic']:requestScreenshotUpload('http://ip:3555/upload/', 'files[]', function(data)
		local resp = json.decode(data)
		
		print(json.encode({ url = resp.files[1].url }))   
	  end)
end, false)```

But nothing happen, not any errors (app.js console, server console, fivem console)
Any ideas?
1 Like

anyone use reignited gcphone? having trouble with the image server for it

I do… did you find any solutions for it?
Thanks!

Working in Gcphone V3?

now i get this
TS2339: Property ‘type’ does not exist on type ‘File | File[]’.