Greetings, I have a backend in node.js for my Android App,the backend receive a encode base64 image, then write using “fs.writeFileSync” but i wanna change to save in DigitalOcean Space, there a way to do that?
PD: Sorry for me bad english
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Click below to sign up and get $100 of credit to try our products over 60 days!
Thanks, for now i am gonna save images in my DO droplet without DO spaces, that’s because are receive the images encoded in base64 and i dont found the way to pass to DO spaces
Try this, you should use the resized images content.
$image_resize = $image_resize->resize(50, 50, function ($constraint) { $constraint->aspectRatio(); })->encode(‘jpg’);
Storage::disk(‘spaces’)->put($thumb_uploads .‘/’.$image->hashName(), (string) $image_resize);
Hi @bytesve,
I’ll recommend giving the following Digitalocean tutorial a read :
In this tutorial, you will create a Node.js application that allows a user to upload a file to their DigitalOcean Space by submitting a form on the front-end of a website. It should help you out in regards to your application as well.
Regards, KFSys