You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to upload a file using client.uploadFromStream by doing something like this:
if(exists(currPath)&&isFile(currPath)){constfileStream=createReadStream(currPath).on('data',(chunk)=>{// logging for stream progress here})// Upload file from streamawaitclient.uploadFromStream(`${nextcloud_path}/${fileName}`,fileStream);}
This does not throw an error and creates a file at the correct location on nextcloud, but the file is 0 Bytes/empty. If I write out the stream to a buffer, it correctly reads the data.
If i use client.put instead, everything works as expected, but then you lose the benefits of using the stream in the first place. Changing the example to the following works as expected and writes the actual content to the file on nextcloud.
if(exists(currPath)&&isFile(currPath)){// Stream for reading in fileconstbufs=[];constfileStream=createReadStream(currPath).on('data',(chunk)=>{bufs.push(chunk);}).on('end',async()=>{constfileBuffer=Buffer.concat(bufs);awaitclient.put(`${nextcloud_path}/${fileName}`,fileBuffer);});}
This leads me to believe that uploadFromStream is not working as I would expect it to.
I have docker set up through TrueNAS, I don't think upload limits are the problem
The text was updated successfully, but these errors were encountered:
I'm trying to upload a file using
client.uploadFromStream
by doing something like this:This does not throw an error and creates a file at the correct location on nextcloud, but the file is 0 Bytes/empty. If I write out the stream to a buffer, it correctly reads the data.
If i use
client.put
instead, everything works as expected, but then you lose the benefits of using the stream in the first place. Changing the example to the following works as expected and writes the actual content to the file on nextcloud.This leads me to believe that
uploadFromStream
is not working as I would expect it to.I have docker set up through TrueNAS, I don't think upload limits are the problem
The text was updated successfully, but these errors were encountered: