question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Metafields With XHRUpload `bundle` option

See original GitHub issue

I needed the meta fields with the bundle option and I saw that it had not been implemented yet so I forked the code and tested it out. It’s fairly simple; I just copied and adapted code from createFormDataUpload. This goes right after the new FormData() in src/plugins/XHRUpload.js. I’m just getting into this code so I was wondering if anyone could take a look at it and see if it makes sense.

      const meta = this.uppy.getState().meta
      const metaFields = Array.isArray(this.opts.metaFields)
        ? this.opts.metaFields
        // Send along all fields by default.
        : Object.keys(meta)
      metaFields.forEach((item) => {
        formData.append(item, meta[item])
      })

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
goto-bus-stopcommented, Mar 12, 2018

Previously we did not implement this because metadata in Uppy can be file specific. It was unclear what the expected behaviour would be when uploading multiple files with different metadata in one request. I think only sending global metadata probably makes sense…

0reactions
kvzcommented, May 22, 2019

Sorry for the long delay, we do want to implement ‘global meta data’, it’s just that we’ve been swamped! @goto-bus-stop has this high up on their list. Goes without saying but we’re also welcoming PRs if this is really important to your use case.

Read more comments on GitHub >

github_iconTop Results From Across the Web

uppy how to add metaFields from Dashboard to XHRUpload
I added metaFields: null, like in doc - Set this to null (the default) to send all metadata fields. , but in server...
Read more >
XHR Upload - Uppy
⚠️ Only use bundle: true with local uploads (drag-drop, browse, webcam), Uppy won't be able to bundle remote files (from Google Drive or...
Read more >
I can't get my CSRF token to send - Uppy
Are you using the bundle: true option for XHRUpload ? At the moment, XHRUpload only sends metadata for uploads that do not use...
Read more >
Metafield content types and values - Shopify Help Center
Metafield content types and values ; True or false, Creates a checkbox for selecting whether a condition is true or false. Add whether...
Read more >
How to Add Shopify Product Bundle with Metafields & Custom ...
Upselling with Shopify Product Bundles is a means of selling many different items as a single combined pack or bundle through a Shopify ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found