0

I am trying to build up a web application with javascript and nodejs. In order to hide the ApplicationID/Key, I use API to handle the data saving.

For example, if I need to save a object on Parse. Instead of using Parse Javascript SDK on the client side, I send the object to the server and then ask server to save the parse.

Everything was working fine until I try to upload images to the server. It turns out I need to somehow upload the images to server before I can save these images to parse class because PFFile need urls to upload the images. But the image at this time is still in local. I was thinking to convert image to base64 string and then server can convert it back to image data and then save it to the parse. However, I didn't succeed with this approach. Can anyone provides some insight? Thanks

1 Answer 1

2

When uploading a image, you can just use

uploadImg(photo):void{
   var parseFile = new Parse.File("image.png", {base64:photo});
   parseFile.save();
}

the parameter photo is base64.

*Are you using AWS s3 to store your images?

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, Lyon. I figured it out 10 mins after I posted this question. But still much thanks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.