# Remote Storage Provider

A Remote Storage Provider is an abstract class representing a provider for remote storage functionalities. This class is intended to be extended by a specific implementation of a remote storage provider. It offers methods to upload and download files, as well as the ability to monitor upload progress.

### Usage

Below is a demonstration of extending the `RemoteStorageProvider` class for a custom implementation. You'll need to provide the actual logic for the `upload` and `download` methods based on your specific remote storage solution.

```ts
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;
  }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wiki.4thtech.io/sdk/storage/remote-storage-provider.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
