uppy icon indicating copy to clipboard operation
uppy copied to clipboard

Uploading files with special characters failing with s3-multipart

Open yoelcabo opened this issue 2 years ago • 2 comments

Hi!

When we started using the s3-multipart plugin we already faced some issues with special characters that we ended up solving by using the workaround in the following closed issue: https://github.com/transloadit/uppy/issues/2380

However, we have recently upgraded Uppy to the latest version and now some providers are failing:

See Dropbox in the following screeshot test.mp3 works fine but tést.mp3 fails. Similar thing happens to Box, but surprisingly Google Drive works fine. image

I believe this is caused by https://github.com/transloadit/uppy/pull/2742

In a custom plugin that we built using your Uploader.js, this fixed the issue:

const initUploader = (req) => {
  req.body.metadata = {} 
  const uploader = new Uploader(Uploader.reqToOptions(req, 100));

However I don't know how to fix this in the custom providers that we have or in Dropbox. Any idea?

In https://github.com/transloadit/uppy/issues/2380 @goto-bus-stop was saying:

@rehamwael Thanks for the report … it looks like we actually don't have a good way around this currently. In other upload plugins, you can specify which metadata to send, but the S3 Multipart plugin does not support that.

How can I specify which metadata to send?

Debugging this has been very challenging: there is no debug logs in Companion (not even with debug: true and in the Web console there is nothing interesting either, only a "Failed to download" error: image

Thanks a lot!

yoelcabo avatar Aug 06 '21 23:08 yoelcabo

EDIT: I found a cleaner way:

metadataRemovalMiddleware = (req, res, next) => {
  // https://github.com/transloadit/uppy/issues/3084
  req.body.metadata = {}
  next()
}


app.post('/:providerName/get/:id', metadataRemovalMiddleware)
app.post('/search/:searchProviderName/get/:id', metadataRemovalMiddleware)

Previous workaroud: As a temporary workaround I have:

  • duplicated the get controller: https://github.com/transloadit/uppy/blob/main/packages/%40uppy/companion/src/server/controllers/get.js
  • overriden the get route to use my controller
  app.use('*', getOptionsMiddleware(options));
  app.post('/:providerName/get/:id', middlewares.hasSessionAndProvider, middlewares.verifyToken, controllers.get)
  app.post('/search/:searchProviderName/get/:id', getOptionsMiddleware(options), middlewares.loadSearchProviderToken, controllers.get)
  app.param('providerName', providerManager.getProviderMiddleware(providers, true));
  app.param('searchProviderName', providerManager.getProviderMiddleware(searchProviders))
  • Crossed my fingers very hard :)

I hope this is useful to someone!

yoelcabo avatar Aug 10 '21 09:08 yoelcabo

By the way (maybe offtopic), we are heavy users of Uppy and we really would not mind paying for having tech support next time we upgrade Uppy or next time we encounter a bug.

Does Transloadit offer that service? :) You can reach me at [email protected] if you think it is offtopic :)

yoelcabo avatar Aug 10 '21 10:08 yoelcabo

Closing this to keep the issue count maintainable and the original issue with special characters doesn't seem to be a problem anymore. Can reopen if needed.

Murderlon avatar Aug 11 '22 10:08 Murderlon