Replies: 4 comments
|
Or, at least, is there a way to access the underlying |
0 replies
|
Have you found a solution |
0 replies
|
Actually, I have! Feels a little hack-y, but it works. It involves getting the raw request payload, and parsing it ourselves. Here's a quick snippet, not a full example: // Using a multiparser elsewhere in the community
import { multiParser } from 'https://deno.land/x/multiparser/mod.ts'
// ...
router
.post('/upload', async (ctx, next) => {
const body = await ctx.request.body({
type: 'form-data'
})
const form = await multiParser(ctx.request.originalRequest.request)
const img = form.files['image-upload'].content
// ...
})Here's a complete example: https://dash.deno.com/playground/jcs224-oak-zbar-multipart I still think this should be fixed within Oak, but this is a good enough workaround for now. |
0 replies
|
The type Lines 111 to 118 in 91b7aaa Try setting a |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
This app works fine with the Deno CLI, but not Deno Deploy:
https://dash.deno.com/playground/jcs224-zbar-wasm-oak
The
multipart/form-datafile upload doesn't work because it's trying to runDeno.makeTempDirand Deploy doesn't have the ability to write files.The failing line is 27,
const data = await body.value.read().Is there a way to get the multipart file data without writing a temp dir? I was able to do this with the web-native
FormDatawithout Oak:https://developer.mozilla.org/en-US/docs/Web/API/FormData/get
All reactions