Forum Discussion

GeorgeTio's avatar
New Member
3 years ago

React file upload

Hello is there any possible way I can upload a file using react, I currently have the following source code


            headers: {
                "Bearer " + token,
              "Content-Type": "multipart/form-data",
            method: "POST",
            body: formData,
            (response) => response.json() // if the response is a JSON object
            (success) => console.log("success", success) // Handle the success response object
            (error) => console.log("error", error) // Handle the error response object
when I try to upload a file i am getting error response code that body is missing
No RepliesBe the first to reply