Browse Source

fix: file attachment bug in windows

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/743/head
Pranav C 3 years ago
parent
commit
34c40ab2ee
  1. 5
      packages/nocodb/src/lib/noco/plugins/adapters/storage/Local.ts

5
packages/nocodb/src/lib/noco/plugins/adapters/storage/Local.ts

@ -15,7 +15,10 @@ export default class Local implements IStorageAdapter {
const destPath = path.join(NcConfigFactory.getToolDir(), ...key.split('/'));
try {
mkdirp.sync(path.dirname(destPath));
await fs.promises.rename(file.path, destPath);
const data = await fs.readFileSync(file.path);
await fs.writeFileSync(destPath, data);
fs.unlinkSync(file.path);
// await fs.promises.rename(file.path, destPath);
} catch (e) {
throw e;
}

Loading…
Cancel
Save