node-formidable / formidable

The most used, flexible, fast and streaming parser for multipart form data. Supports uploading to serverless environments, AWS S3, Azure, GCP or the filesystem. Used in production.
MIT License
7.05k stars 682 forks source link

Express + Formidable not triggering any events :( #721

Closed AriefLuthfi79 closed 3 years ago

AriefLuthfi79 commented 3 years ago

Well, all of events formidable not getting fired, i've been disabled all of my middlewares

I have tried google, stackoverflow, github issues but couldn't find anything related to this, so i hope it's ok to file this issue.

Cheers :)

AriefLuthfi79 commented 3 years ago
export const createWidgetIconByClient = async (
  req: Request,
  res: Response,
  next: NextFunction
): Promise<any> => {

  var responses = [];
  const form = new formidable.IncomingForm({ multiples: true });
  const dirUploads: string = './public';
  const regex = new RegExp("(.*?)\.(svg|png|jpg|jpeg)$");

  form.on("file", (tes, oke) => {
    console.log("aowjoawoj");
  });
  }
AriefLuthfi79 commented 3 years ago

I hope someone could helped me out :)

GrosSacASac commented 3 years ago

do you ever form.parse ?

AriefLuthfi79 commented 3 years ago

@GrosSacASac yeah i've been using form.parse, but my problem is for multiple upload files

AriefLuthfi79 commented 3 years ago

@GrosSacASac thanks for help, i solved my problem with form.parse instead of event trigger