Closed hastagAB closed 1 month ago
@Pradyuman7 Please review the PR
Looks good @hastagAB - can you resolve the conflict and we can merge?
@awilkescom Resolved. Please merge!
Great, good work!
Hi @hastagAB I'm trying to upload an image from the frontend to the backend, and while the form data seems to be coming through, I'm consistently receiving a 415 error from the /resume/experience endpoint. I've logged the payload from the frontend and attached a screenshot. Could you take a look and let me know if you have any insights on this?
Hi @larrytamnjong, try with multipart/form-data
in all cases. Make sure you're using FormData to submit your file and other fields.
fetch('/resume/experience', { method: 'POST', body: formData, }) .then(response => response.json()) .then(data => { console.log('Success:', data); }) .catch(error => { console.error('Error:', error); });
@hastagAB I am sending form data in all cases, and I realized the issue is with using request.get_json()
. When I changed the function in the experience route to use request.form
directly, it worked. The method request.get_json()
throws a 415 error. You can read more about it here: Flask Request Documentation.
@larrytamnjong Ah okayy! I'm glad it worked.
closes #2
Add functionality to upload and store logos for Experience, Education, and Skill objects in the
uploads/
directory.(default.jpg)
is used.