Skip to content

formData fields support.#7

Open
rcfrias wants to merge 1 commit intofreesoftwarefactory:masterfrom
rcfrias:patch-2
Open

formData fields support.#7
rcfrias wants to merge 1 commit intofreesoftwarefactory:masterfrom
rcfrias:patch-2

Conversation

@rcfrias
Copy link
Copy Markdown

@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
Copy Markdown
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
Copy Markdown
Author

rcfrias commented Aug 17, 2017

Still missing to test:

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

@jeprojects
Copy link
Copy Markdown

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

@christiansalazar
Copy link
Copy Markdown
Contributor

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

@fhackenb
Copy link
Copy Markdown

fhackenb commented Oct 8, 2018

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

@fhackenb
Copy link
Copy Markdown

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
Copy Markdown

Thanks, this helped me a lot!

@adimoraret
Copy link
Copy Markdown

Great!!! This PR worked for me.

@AyaMagdyMohamed
Copy link
Copy Markdown

Why this pull request not merged?

@keroloswilliam
Copy link
Copy Markdown

keroloswilliam commented Sep 5, 2019

is there an ETA on the merging this PR

@theresazobel
Copy link
Copy Markdown

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

@wips
Copy link
Copy Markdown

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
Copy Markdown

MERGE THIS NOW.

Please. It has solved my issues.

@christiansalazar
Copy link
Copy Markdown
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
Copy Markdown

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.