Ask coding questions

← Back to all posts
How would you do this?
ShivankChhaya (240)


I have this game I'm working on, and I have the user submitting a profile picture. I need a path or string version of that image that can be turned into an image to be used later. It turns into a string, gets sent in an HTTP GET request, then stored in a database in the python file, then accessed by the javascript in a different file. When I try this, it does not work. How would you do it?

I have searched vast and wide over many search engines and websites. Please help, this is extremely confuddling.

Answered by ch1ck3n (2076) [earned 5 cycles]
View Answer
ch1ck3n (2076)


first upload the picture

then get the base64 string of that picture using javascript

upload that to the server

store it somewhere like /pictures

and make an API to get the picture

ShivankChhaya (240)

@ch1ck3n how exactly would you do all this?

I know how to get the picture and can easily figure out how to get the base64 string, but what exactly do you mean by "upload it to the server" and how would you store it somewhere

ShivankChhaya (240)

@ch1ck3n sorry for another ping, but I have the base64 string, how would you turn that into a valid image source?

ch1ck3n (2076)

@ShivankChhaya that is a valid image source

ShivankChhaya (240)

@ch1ck3n ok thanks!

I will remember to give you credit on the final post

ShivankChhaya (240)

@ch1ck3n still, you may not realize it, but you helped the entire game