Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

Add how-to upload images/files (bytea) #540

Open
laurenceisla opened this issue May 24, 2022 · 0 comments
Open

Add how-to upload images/files (bytea) #540

laurenceisla opened this issue May 24, 2022 · 0 comments

Comments

@laurenceisla
Copy link
Member

There's an issue right now with binaries sent using multipart/form-data PostgREST/postgrest#922 (comment), but there is an alternative using Javascript, for example with fetch:

const input = document.getElementById('myFileInput'');

fetch('http://localhost:3000/rpc/upload_binary', {
  method: 'POST',
  headers: {
    "Content-Type": "application/octet-stream"
  },
  body: input.files[0]
})

An example using fetch could be added while working on the multipart/form-data implementation.

@laurenceisla laurenceisla changed the title Add how-to updload images/files (bytea) Add how-to upload images/files (bytea) May 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

1 participant