Uploading file with file name #4069
-
Hello, Looking at examples here and here, I’m able to build an endpoint to upload a binary file; however, without filename. How would I go about adding a filename to the upload request? I could imagine using the Content Disposition header with a multipart body (see also open issue #922), or is there some other path forward? I’d like to avoid use Base64 encoded JSON payloads. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
Right now, you could use a custom header and read it via https://docs.postgrest.org/en/v12/references/transactions.html#request-headers-cookies-and-jwt-claims. In theory, if we could mix an unnamed bytea parameter with named parameters, which would then be passed on the query string, that could be quite flexible. So I imagine doing something like RIght now, you could fake something like it in a reverse proxy: For example have an endpoint |
Beta Was this translation helpful? Give feedback.
Right now, you could use a custom header and read it via https://docs.postgrest.org/en/v12/references/transactions.html#request-headers-cookies-and-jwt-claims.
In theory, if we could mix an unnamed bytea parameter with named parameters, which would then be passed on the query string, that could be quite flexible. So I imagine doing something like
POST /files?name=xxxx
- and then the raw bytea body. But we don't have that, yet.RIght now, you could fake something like it in a reverse proxy: For example have an endpoint
/files/xxx
, where a POST to it would take thexxx
part and put it in the custom header mentioned above.