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.

SetFileMeta params not available to AddFile event

See original GitHub issue

Manually adding files as I’m using an HTML5 drag and drop:

  const id = ulid()

  const fileId = uppy.addFile({
    name: `${d}|${file.name}`,
    type: file.type,
    data: file,
    source: "Local",
    isRemote: false,
  })

  uppy.setFileState(fileId, {
    //uploadURL: "http://localhost:3100/upload",
    progress: { uploadComplete: false, uploadStarted: false },
  })
  
  uppy.setFileMeta(fileId, {
    fileId: id,
    fileuuid: fileId,
  })

Elsewhere in my code:

  useEffectOnce(() => {
      uppy.setMeta({
        parentId: parentId,
        sessionId: "",
        userId: userId,
      })

      uppy.on("files-added", (result) => {
        const item = result[0]

        console.log(result)

Issue.

I’m expecting both fileId and fileuuid to be present in meta, from the addfile event.

[
    {
        "source": "Local",
        "id": "uppy-1629121491/exif/image1/jpg-3s-2v-1e-image/jpeg-114913-1567870171799",
        "name": "1629121491|exif_image1.jpg",
        "extension": "jpg",
        "meta": {
            "parentId": null,
            "sessionId": "",
            "userId": "01EZ09H2T2GM33MA13XH96NVSG",
            "name": "1629121491|exif_image1.jpg",
            "type": "image/jpeg"
        },
        "type": "image/jpeg",
        "data": {
            "filepath": "exif_image1.jpg"
        },
        "progress": {
            "percentage": 0,
            "bytesUploaded": 0,
            "bytesTotal": 114913,
            "uploadComplete": false,
            "uploadStarted": null
        },
        "size": 114913,
        "isRemote": false,
        "remote": ""
    }
]

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
Murderloncommented, Aug 17, 2021

@arturi do you know if certain methods cancel each other out? Or if something else is going on here?

0reactions
Murderloncommented, Aug 18, 2021

Thanks for posting the update. I’m going to close this as it’s seems to be an implementation issue on your side in combination with React. If you still think this is a genuine bug, feel free to elaborate again and we may reopen.

Read more comments on GitHub >

github_iconTop Results From Across the Web

const - Uppy
For files that are imported from remote providers, the file data is not available in the browser. file.progress. An object with upload progress...
Read more >
setFileMeta not passing params after upgrade #2240 - GitHub
I am not sure but since it appears to happen with recent aws-s3 versions, I think we may be working with an outdated...
Read more >
Sending additional parameter with dropzone.js - Stack Overflow
the params option is what i found to send additional data with dropzone. the params option parametes are received in $_POST and uploaded...
Read more >
BeamBkgHitRateMonitorModule Class Reference
Returns true and prints error message if the module has unset parameters which the user has to set in the steering file.
Read more >
backend/public/plugins/uppy/website/src/docs/uppy.md
addFile attempts to determine file type by magic bytes + the provided type + extension; then checks if the file can be added, ......
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