By Yubel Rojas
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
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi @bytesve,
I’ll recommend giving the following Digitalocean tutorial a read :
https://www.digitalocean.com/community/tutorials/how-to-upload-a-file-to-object-storage-with-node-js
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
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);
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
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.