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

Wrote value is 0 #2

Closed anroopak closed 7 years ago

anroopak commented 7 years ago

On upload complete, the wrote value is 0. File gets created with 0 bytes size. How to handle this?

rico345100 commented 7 years ago

@anroopak I just checked my module and it was displayed wrote bytes not 0 both client and server side. Can you describe more detail please? :) Also don't forget to update to latest version of socket.io-file :)

anroopak commented 7 years ago

@rico345100 For some of the uploads, the wrote value is coming as 0. I am using the following versions.

"socket.io": "^1.7.2",
"socket.io-file": "^2.0.1"
anroopak commented 7 years ago

These are the logs.

Start uploading
{ name: 'fac72b4d-5bc9-4b15-a5bd-3ad69df0c2cf_48_15622089_1727885544206244_1058843473527910847_n.jpg',
  size: 32227,
  uploadDir: 'views/data/fac72b4d-5bc9-4b15-a5bd-3ad69df0c2cf_48_15622089_1727885544206244_1058843473527910847_n.jpg' }
Upload Complete.
{ name: 'fac72b4d-5bc9-4b15-a5bd-3ad69df0c2cf_48_15622089_1727885544206244_1058843473527910847_n.jpg',
  size: 32227,
  wrote: 0,
  uploadDir: 'views/data/fac72b4d-5bc9-4b15-a5bd-3ad69df0c2cf_48_15622089_1727885544206244_1058843473527910847_n.jpg',
  mime: 'image/jpeg',
  estimated: 0 }
rico345100 commented 7 years ago

That could be happen if there was already same named file exists with overwrite: false option. overwrite option is false by default, for prevent unexpected data overwritten.

If you just want to directly overwrite the file, simply sets the overwrite option true. But if you want to upload but want to avoid name duplication, you can use rename option to specify the rules of file name creation with own described function.

rico345100 commented 7 years ago

Any progress? Can I close this issue?

rico345100 commented 7 years ago

I'm closing this issue because you didn't answer it. If you get continue about this, you can reopen anytime, thanks!