craftql icon indicating copy to clipboard operation
craftql copied to clipboard

Mutation: upload file directly from browser

Open nelhop opened this issue 5 years ago • 0 comments

Is there a way to upload an image directly from the Browser, without loading it to a public server before?

Already working:

mutation uploadImage ( $image: [FotoAssetInput] ) {
  upsertXYZ ( image: $image ) {
    id
  }
}
{
  "image": [{"url": "https://placekitten.com/g/200/300"}]
}

Seeked feature:

{
  "image": [{"file": "File Object"}],
  "image": [{"base64": "data:image/jpg;base64,iVBORw0KGgoAAAANSUhEUgAABZwAAAF..."}],
}

nelhop avatar May 11 '20 09:05 nelhop