Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

formData fields support. #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rcfrias
Copy link

@rcfrias rcfrias commented Aug 17, 2017

This will enable the Parser to parse field parts included in formData. Ej. (parsed data):
parts:
{ name: 'name', data: 'test product' }
{ name: 'code', data: 'product code' }
{ name: 'category', data: 'product category' }
{ filename: 'productImage.jpg',
type: 'image/jpeg',
data: <Buffer ef bf bd ef bf bd ef bf bd ef bf bd 00 10 4a 46 49 46 00 01 01 00 00 01 00 01 00 00 ef bf bd ef bf bd 00 43 00 03 02 02 02 02 02 03 02 02 02 03 03 03 ... > }

This will enable the Parser to parse field parts included in formData. Ej. (parsed data):
parts: 
{ name: 'name', data: 'test product' }
{ name: 'code', data: 'product code' }
{ name: 'category', data: 'product category' }
{ filename: 'productImage.jpg',
  type: 'image/jpeg',
  data: <Buffer ef bf bd ef bf bd ef bf bd ef bf bd 00 10 4a 46 49 46 00 01 01 00 00 01 00 01 00 00 ef bf bd ef bf bd 00 43 00 03 02 02 02 02 02 03 02 02 02 03 03 03 ... > }
@rcfrias
Copy link
Author

rcfrias commented Aug 17, 2017

This solves scenarios like

  • Profile Image+data
  • Product Image+data
  • etc.

Tests for collections of multiple Image+data to follow...
i.e. importing products (batch processing style)

@rcfrias
Copy link
Author

rcfrias commented Aug 17, 2017

Still missing to test:

  1. Batch parsing
  2. Validations (empty fields &| files)

@jeprojects
Copy link

@rcfrias Tested this, now form data is working correctly. Thanks!

@christiansalazar
Copy link
Contributor

i need to find some time for this project. 2 pending merge requests..very sorry, 3 jobs is hard.

@fhackenb
Copy link

fhackenb commented Oct 8, 2018

Thanks for this PR, works well for me too! Hope it gets merged soon

@fhackenb
Copy link

fhackenb commented Oct 31, 2018

I was getting an error for empty input fields - I was able to fix it by adding a try catch block around allParts.push(process(p));

@StevenPMX
Copy link

Thanks, this helped me a lot!

@adimoraret
Copy link

Great!!! This PR worked for me.

@AyaMagdyMohamed
Copy link

Why this pull request not merged?

@keroloswilliam
Copy link

keroloswilliam commented Sep 5, 2019

is there an ETA on the merging this PR

@theresazobel
Copy link

It's been over 2 years, please merge this soon! This helps a lot!

@wips
Copy link

wips commented Jun 24, 2020

Faced the same issue and found that there's a forked repo where the issue is fixed - https://www.npmjs.com/package/parse-multipart-data. Just in case someone else needs it.

@AndrewJayDev
Copy link

MERGE THIS NOW.

Please. It has solved my issues.

@christiansalazar
Copy link
Contributor

im very sorry, i cant. because some critical components in my side is actively using the master branch as-is. so, because i cant perform testing to verify the impact in my products (and others, from different people) then: i cant.

@AndrewJayDev
Copy link

AndrewJayDev commented Oct 7, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet