Quantcast
Channel: Active questions tagged symfony4 - Stack Overflow
Viewing all articles
Browse latest Browse all 3917

get FormData call ajax to symfony 4

$
0
0

My code js is:

fetch(img).then(response => response.blob()) //img is canvas with method toBlob('image/png')  .then(blob => {    console.log(blob)    const fd = new FormData();    fd.append("fileName", blob, "file.ext");    return fetch("/sendImg", {      method: "POST",      fd    })  })  .then(response => response.ok)  .then(res => console.log(res))  .catch(err => console.log(err));

Symfony not working with any things:

 $_REQUEST['fileName']) || isset($_FILES['fileName']) || $request->files->get('fileName')

Viewing all articles
Browse latest Browse all 3917

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>