Rsuite Uploader don't send me the file to Express server

Viewed 18

I'm trying to use a Uploader component from RSuite, for upload a picture to the Express server:

<Uploader action={process.env.REACT_APP_API_URL + '/loadMap'} draggable headers={{Authorization: 'Bearer ' + localStorage.getItem('token')}} name="map">
    <div style={{ width: '100%', height: 300, display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
        <span>Click or Drag map image to this area to upload</span>
    </div>
</Uploader>

When I upload an image, the request arrive to the Express, but I can't found the content of the image that I upload. In the Request (IncomingMessage) I can't found the attribute 'files' or 'file' or nothing that have the content of the picture:

exports.loadMap = async (req, res, next) => {
    let mapContent = req.body.map;
    let mapFile = req.file;
}

How can I get this content for save into the server? Thanks.

0 Answers
Related