perry-mitchell / webdav-fs

Node fs wrapper for WebDAV
MIT License
94 stars 21 forks source link

createwriteStream binary file #68

Closed simonzander closed 3 years ago

simonzander commented 5 years ago

Hi i want to stream a binary file. (huge file) But is always empty.

var readStream = fs.createReadStream("./public/files/test.exe"); readStream.setEncoding('binary'); readStream.pipe(wfs.createWriteStream("/test.exe"));

perry-mitchell commented 5 years ago

Are you doing this in Node? Could you use the --inspect flag and check what the network request+response look like?

Also, your path is wrong as it contains a relative path. Paths on WebDAV should be absolute.

EDIT: You could also listen for errors on the stream, and see if you get more info there.