Chuyển tới nội dung chính

removeSavedFile

Xoá local file đã lưu.

Parameters​

Object object​

PropertyTypeDefaultRequiredDescriptionMinimum Version
filePathstringtrueĐường dẫn tới file trong folder đã lưu cục bộ
successfunctionCallback function khi gọi api thành công
failfunctionCallback function khi gọi api thất bại

Sample Code​

import { LFSStorage } from 'zmp-sdk/apis';

LFSStorage.removeSavedFile({
filePath: "Đường dẫn tới file",
success: () => {
// xử lý khi gọi api thành công
},
fail: (error) => {
// xử lý khi gọi api thất bại
console.log(error);
},
});

// hoặc

import { LFSStorage } from 'zmp-sdk/apis';

const removeSavedFile = async () => {
try {
await LFSStorage.removeSavedFile({
filePath: "Đường dẫn tới file",
});
} catch (error) {
// xử lý khi gọi api thất bại
console.log(error);
}
};

Errors​

CodeMessageNote
-302File cannot be found. Please check your param again.