rico345100 / socket.io-file

Socket.io-file is a node module for uploading file via Socket.io module
MIT License
48 stars 19 forks source link

this.rename is not a function #4

Closed jfmmm closed 7 years ago

jfmmm commented 7 years ago

There a bug when you use the rename option.

TypeError: this.rename is not a function
    at Socket.<anonymous> (/Users/username/Documents/projects/projectName/node_modules/socket.io-file/index.js:91:20)
    at emitOne (events.js:90:13)
    at Socket.emit (events.js:182:7)
    at /Users/username/Documents/projects/projectName/node_modules/socket.io/lib/socket.js:503:12
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9)
rico345100 commented 7 years ago

Hi, jfmmm. rename is available after v2.0.1, so please check your current version of socket.io-file. Or if you already using it, could you paste your code that using or related with Socket.io-file? It is hard to figuring out what is the problem without specific details :)

jfmmm commented 7 years ago

Yeah no I have 2.0.1, but I found why..

I just assumed that I could just pass a string to the rename option like rename: "myNewFilename.xls".. didn't realize it had to be a function.

rico345100 commented 7 years ago

Oh, I didn't thought about that passing new filename directly. I will add plain string support for rename option.

rico345100 commented 7 years ago

Hey :) I just updated to support string rename option. Make sure update Socket.io-file to latest version! Thanks!