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.

Pass metadata to backend

See original GitHub issue

@goto-bus-stop Hello, how can I pass meta data information to backend tus node server through uppy tus endpoint ? I want to get that information on my backend server such as file original name, mime type and size so I can rename the file to its original name or whatever filename is set in metaField option in uppy.

On my backend, I get only file id, name (encoded), type (encoded). server.on(EVENTS.EVENT_UPLOAD_COMPLETE, (event) => { console.log(`Upload complete for file ${event.file.id}`); });

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
goto-bus-stopcommented, May 14, 2018

Renaming the file on backend (node js and express js) after upload is completed by decoding the name as you suggested.

I suggested decoding the upload_metadata property, not the name 😃

Uppy does not have additional requirements beyond what tus-js-client has.

As I understand it the HEAD 404 response is expected when you move the file, and should not affect the upload further.

When I remove the GET method from backend and try to reupload the same file again without deleting the old one, then there are no errors such as HEAD 404 or Refused to get unsafe header “Upload-Offset”

It looks like you were overriding the /upload/files/:fileId route from the tus node server, which may be why you get the error about Upload-Offset. I think that is also why it works correctly when you remove that route, you’re probably not supposed to override it.

I’m a bit lost—it seems like the problem is no longer with reading metadata on the server is it? I’m struggling to piece together what is going wrong / unexpected from the comments so far.

0reactions
Acconutcommented, May 10, 2018

But I get this behavior only when I remove the GET method from the backend. I hope somebody from uppy team will explain it further.

Ok, since tus-js-client does not do GET requests, this might be caused by Uppy but I cannot help there much 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Understand How Metadata Works in User Profiles - Auth0
Describes Auth0 user, application, and client metadata. Learn how you can use metadata to store information that does not originate from an identity ......
Read more >
How do I upload a file with metadata using a REST web service?
To create the metadata entry and return a response like: ... say, compute the target dir/filename based on json metadata passed along the...
Read more >
[LLVMdev] LLVM Metadata from Pass to Backend optimization
[LLVMdev] LLVM Metadata from Pass to Backend optimization ... Metadata structure to pass the data from the Analysis > Pass to the Back...
Read more >
[llvm-dev] How to pass custom metadata from IR module pass ...
Ideally I would want to attach some metadata to a IR instruction, and have it be accessible when I perform a backend MF...
Read more >
MetaData Encryption - Passbase Docs
After encrypting the data in your backend, you will need to pass the private key encoded in base64 to Passbase through the client-side...
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