skip to Main Content

Php – Undefined array key in Form Data

I am trying to upload an image using form Data. But the name of the form field server expects is not recognizable. Warning: Undefined array key "photo" Below is my code: index.html html> <head> <script type = "text/javascript" src="index.js"></script> </head>…

VIEW QUESTION

Javascript – Blob generated from base64-encoded png image within FormData instance recognized as application/octet-stream on server-side

Okay so I have a correctly, base64-encoded png image, that I convert into a Blob as such: const match = imgBase64String.match(/^data:image/(w+);base64,/); if (!match) { throw new Error("Failed to decode base64-string."); } const imageSuffix = match[1]; const base64StringWithoutPrefix = imgBase64String.replace( /^data:image/w+;base64,/,…

VIEW QUESTION
Back To Top
Search