Skip to content

Unable to send Buffer or base64 image via entity service or upload plugin #15524

@cpaczek

Description

@cpaczek

Bug report

Required System information

Node: v18
Strapi: 4.5.6
OS: Windows 10]
DB: SQLite

Describe the bug

There is not a way afaik to send a buffer image or a base 64 image using the Entity Service API or the upload plugin. There is this forum post but it seems like a janky way to do this and I couldn't get it working: https://forum.strapi.io/t/upload-buffer-using-strapi-upload/18807

Steps to reproduce the behavior

Create new strapi app.
Try an upload a buffer using the entity service API.

Expected behavior

Ability to pass buffer or similar node js datatype within entity service

Code snippets

            await strapi.entityService.create('plugin::og-generator.og-image', {
                populate: '*',
                data:{
                    collection: collectionName,
                    collectionID: id
                },
                files:{
                    media: image
                }
            })
        }catch(err){
            console.log(err)
        }```

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Archive

    Status

    Fixed/Shipped

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions