By uppalsonia9
I have my code written in JQuery where I am uploading a file (resume) var input = document.getElementById('resumeFile); var file = input.files[0]; $.post({ url: “url of the space-object storage”, data : file, success: function(response) { alert(‘Success’+response); }, error: function(error) { alert(‘Failed’); }
I dont see the file in the space. Can someone throw some light where I am going wrong
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,
Spaces requires authentication for uploads. I strongly recommend that you move this logic to the back-end as you definitely do not want your API key sent to all visitors to be used by client-facing jQuery—it gives everyone the ability to view all your Spaces and perform all kinds of operations on them including downloading all data and deleting it.
You should be able to use any S3-compatbile library so depending on which language the backend is written in. Here is an example for Node.js: https://www.digitalocean.com/community/tutorials/how-to-upload-a-file-to-object-storage-with-node-js
For reference, documentation on the Spaces API is available here: https://developers.digitalocean.com/documentation/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.