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')