vimeo / vimeo.js

Official Node.js library for the Vimeo API.
https://developer.vimeo.com
Apache License 2.0
267 stars 78 forks source link

Node Express - Vimeo upload file size problem #189

Open celalozlal opened 1 year ago

celalozlal commented 1 year ago

Hi,

There is something wrong with this code block. node_modules>vimeo>lib>vimeo.js>Vimeo>upload Line 451

// Ignore any specified upload approach and size. if (typeof params.upload === 'undefined') { params.upload = { 'approach': 'tus', 'size': fileSize } } else { params.upload.approach = 'tus' params.upload.size = fileSize // This code is useless }

When you use express-fileupload with express file this code block return param.filesize error. You can pass file size param on your code but this code block try to calculate file size via file parametre. So It is not working right.

You have to change this line like this.

// Ignore any specified upload approach and size. if (typeof params.upload === 'undefined') { params.upload = { 'approach': 'tus', 'size': fileSize } } else { params.upload.approach = 'tus' params.upload.size = params.upload.size // Change this line }