Category: javascript

Symfony : uploading file, working from Postman, not from Javascript nor cURL

I’m trying to make a request from a Javascript file to an upload file route made with Symfony and API Platform. REQUESTS : With Postman, using the file input under form-data and using the GUI, the upload works (201 response)….

Uncaught TypeError: Cannot set property ‘el’ of undefined on fullcalendar.js:4368

I have a calendar application where when I add a new item on the calendar on this line of code: $this.$blockCalendar.fullCalendar(‘renderEvent’, { title: resources+”S x “+capacity+”C = “+(capacity*resources), start: start, end: end, allDay: false }, true); $this.$modal.modal(‘hide’); This is the…

How can I process a form treatment in background and display a message to the user on submit in Symfony 4 (PHP)

I have a form which has an execution time of about 10 minutes. I want to display a message to the user on submit while the execution as been done in background to avoid the user to wait for it…

React – share state beetween separated React Apps possible?

I wrote a React-App and now I want to implement some Tab-Navigation. The problem is, my react app is integrated in a Symfony-Project that uses Twig templates. So my React-App lives in templates/dashboard/index.html.twig: {% block content %} <div id=”react-app”></div> {%…

get FormData call ajax to symfony 4

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…