smb2 getting Access denied error on delete a file

0

I am using @marsaud/smb2 npm module to access the files in Network attached ,storage (i.e NAS drives). I am able to read and write the files successfully, below is my code -

const SMB2 = require('@marsaud/smb2');

let opt = {
      "share":config.share,
      "domain":config.domain,
      "username":config.user,
      "password":config.password
};

let smb2Client = new SMB2(opt);

But when I'm trying to delete a file from the drive its throwing the Access denied error, below is my code -

let deleteFile = async (filepath)=>{
       try{
           await smb2Client.unlink(filepath);
        } catch(ex){
           console.log(ex)
       }
}

the error I'm getting on unlink operation is -

Error: STATUS_ACCESS_DENIED (0xC0000022) : {Access Denied} A process has requested access to an object but has not been granted those access rights.
code: 'STATUS_ACCESS_DENIED'

If anyone had the same issue ever please help me out to fix this.

Thanks!

node.js
smb
nas
asked on Stack Overflow Apr 8, 2021 by Saurabh Sharma • edited Apr 8, 2021 by Saurabh Sharma

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0