Well-versed on TS/JS and Python. Recently working on NestJS, Vue3 + Tailwind CSS, Three JS, FastAPI, Jupyter for data visualization.
My recent open-source projects/contributions:
Module to parse multipart/form-data on Azure Functions.
Home Page: https://azure-function-multipart.stor.my.id
License: Apache License 2.0
Well-versed on TS/JS and Python. Recently working on NestJS, Vue3 + Tailwind CSS, Three JS, FastAPI, Jupyter for data visualization.
My recent open-source projects/contributions:
Getting the following error now when I try to pass only the request object from my Azure Function to parseMultipartFormData():
Argument of type 'HttpRequest' is not assignable to parameter of type 'HttpRequest & { headers: { "content-type": string; }; }'.
Type 'HttpRequest' is not assignable to type '{ headers: { "content-type": string; }; }'.
Types of property 'headers' are incompatible.
Property '"content-type"' is missing in type 'HttpRequestHeaders' but required in type '{ "content-type": string; }'.
const { fields, files } = await parseMultipartFormData(req);
Hi @anzharip
in the readme we have
{
"fieldname": "update",
"value": "false",
"fieldnameTruncated": false,
"valueTruncated": false,
"encoding": "7bit",
"mimetype": "text/plain"
}
this is wrong - should be:
{
"name": "update",
"value": "false",
"nameTruncated": false,
"valueTruncated": false,
"encoding": "7bit",
"mimetype": "text/plain"
}
Perhaps you forgot to update the readme. ๐
We've been using this package successfully for our Azure Functions using v3 programming model (with function.json files).
When we started our migration to v4 programming model we discovered that the parsing of multipart form data fails due to Exception: Missing Content-Type
, even if headers from the request are identical as before.
Whats seems have changed is that @azure/functions
package use a different definition of HttpRequest
in version 4.
At the moment we are using the following workaround, but it would be preferable with support in @anzp/azure-function-multipart package:
const headers = {}
for (const [key, value] of request.headers.entries()) {
headers[key] = value
}
const { files, fields } = await parseMultipartFormData(
{ ...request, body: Buffer.from(await request.arrayBuffer()) },
{ headers }
)
Yesterday, I've updated to the new Azure Functions Core Tools
Azure Functions Core Tools
Core Tools Version: 4.0.4544 Commit hash: N/A (64-bit)
Function Runtime Version: 4.3.2.18186
It seems that busboy has some problems, the events don't get fired any more and the functions runs endlessly.
I'm currently trying to find the root cause.
It doesn't work locally neither on Azure.
Hi, I get this error.
Code:
const parseMultipartFormData = require('@anzp/azure-function-multipart')
module.exports = async function (context, req) {
const { fields, files } = await parseMultipartFormData(req)
}
...
Function Runtime Version: 4.0.1.16815
What could be wrong?
Hi, I browsed your library and I feel that it might help me solve a direct issue I'm having with multipart form data. However, I can't import using CommonJS and I don't have the liberty of upgrading the runtime to support ES Modules. Is there a way I could bypass the problem and if not, do you think you could support this? Thanks.
error TS2345: Argument of type 'import("C:/work/node_modules/@azure/functions/types/http").HttpRequest' is not assignable to parameter of type 'import("C:/work/node_modules/@anzp/azure-function-multipart/node_modules/@azure/functions/types/http").HttpRequest'.
Type 'HttpRequest' is missing the following properties from type 'HttpRequest': get, parseFormBody
29 const { fields, files } = await parseMultipartFormData(request);
~~~~~~~
#373 is similar to this Issue, but I believe the cause is different.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.