Uploading pdf file to webhook.

Hello, I try to send a pdf file using the upload component to a post webhook in a form-data. But I can’t…

How can I do something like that :

Upload

<script>
    function uploadFile() {
        const fileInput = document.getElementById('fileInput');
        const file = fileInput.files[0];

        if (file) {
            const formData = new FormData();
            formData.append('file', file);

            // Utilisez Fetch au lieu de cURL pour les requêtes depuis le navigateur
            fetch('<http://example.com/upload>', {
                method: 'POST',
                body: formData
            })

using the configure operation pannel?

It looks like you have both a Plasmic form submit handler and a custom JavaScript script snippet, I don’t think you can use the latter and you have to use a former

Hello, i don’t need the last one I agree. But the first one doesn’t work. I have a 502 error. I just want to send the data of the form including the uploaded file to the server. But it refuses to leave plasmic.app

Of you have any examples of a submit handled with an uploaded files in a form data, I will be more than happy.