You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Question: How to use inside Google Cloud Run? #1029
you should be able to pass request-like object that has a binary req.body and req.headers (nodejs like headers, i think object)
that would be a lot easier and supported with v4. You can try formidable@next with parseMultipart(body, { boundary: 'boundary here' }) or parseMultipartRequest as seen here #1011 (comment)
@boustanihani I had a need for this as well (I had to preserve the rawBody for some security check). It seems like it's working well with v3 already, as @tunnckoCore mentioned, when you re-construct the request. This worked for me:
const rawBody = req.body as Buffer;
return new Promise((resolve, reject) => {
const form = formidable({
keepExtensions: true,
});
const stream = new Readable();
stream.push(rawBody);
stream.push(null);
(stream as IncomingMessage).headers = {
...req.headers,
'content-length': rawBody.length.toString(),
};
form.parse(stream as IncomingMessage, (err, fields, files) => {
// parsing fields/files here
}
@boustanihani sorry, a bit packed with other stuff, probably after new year. But it's in preview in the next dist-tag, nothing much to be changed in there apart from some security measures against a big security vulnerability I was reported that all prior versions has - and have a patch ready for v2 & v3 versions.
Activity
tunnckoCore commentedon Jul 22, 2025
@boustanihani heya
you should be able to pass request-like object that has a binary
req.bodyandreq.headers(nodejs like headers, i think object)that would be a lot easier and supported with v4. You can try
formidable@nextwithparseMultipart(body, { boundary: 'boundary here' })orparseMultipartRequestas seen here #1011 (comment)boustanihani commentedon Jul 22, 2025
Thanks, I will wait until v4 gets released and test this.
PaulvanMotman commentedon Aug 18, 2025
@boustanihani I had a need for this as well (I had to preserve the rawBody for some security check). It seems like it's working well with v3 already, as @tunnckoCore mentioned, when you re-construct the request. This worked for me:
boustanihani commentedon Dec 22, 2025
When will v4 be ready :) ?
tunnckoCore commentedon Dec 22, 2025
@boustanihani sorry, a bit packed with other stuff, probably after new year. But it's in preview in the
nextdist-tag, nothing much to be changed in there apart from some security measures against a big security vulnerability I was reported that all prior versions has - and have a patch ready for v2 & v3 versions.boustanihani commentedon Dec 22, 2025
Thanks, I am currently using the workaround @PaulvanMotman suggested, it works :)
boustanihani commentedon Apr 16, 2026
@tunnckoCore do we have an official example for usage inside Google Cloud Run somewhere?
I checked https://github.com/node-formidable/formidable/tree/master/examples and also the docs but couldn't find anything relevant,
tunnckoCore commentedon Apr 19, 2026
@boustanihani oh, sorry. Well, we don't have. But it's something close to #594 (eg.
formidable-serverless), i believe, no?boustanihani commentedon Apr 28, 2026
Yes, it's the same subject, but this one is specifically for Cloud Run :)
tunnckoCore commentedon May 15, 2026
@boustanihani oh! gosh, i always mis-read that ;d
well, the new api would be more minimal and standards compliant so it won't have such problems to begin with.
(i'm referring v4)
boustanihani commentedon May 15, 2026
When do you expect v4 to be officially released?