Remote Storage Provider
Usage
import type { FileInput } from '@4thtech-sdk/types';
import { RemoteStorageProvider } from '@4thtech-sdk/storage';
class MyRemoteStorageProvider extends RemoteStorageProvider {
public async upload(file: FileInput, fileName: string): Promise<string> {
// TODO: Implement the logic to upload the file to your storage.
// Emitting the upload progress (for demonstration, assuming 100% here).
this.emitUploadProgress(100, fileName);
// Replace with the actual uploaded file URL.
const uploadedFileUrl = 'https://your-storage.com/path-to-uploaded-file';
return uploadedFileUrl;
}
public async download(url: string): Promise<ArrayBuffer> {
// TODO: Implement the logic to download the file from your storage.
// Replace with the actual file content.
const fileContent = new ArrayBuffer(0);
return fileContent;
}
}Last updated
