uploadFromFile method
Stream<BlobUploadProgress>
uploadFromFile({
- required String filePath,
- List<
String> ? serverUrls, - String? contentType,
- UploadStrategy strategy = UploadStrategy.mirrorAfterSuccess,
- bool serverMediaOptimisation = false,
- AuthPolicy? auth,
Upload a file from disk path For native platforms (Windows, macOS, Linux, Android, iOS): uses actual file system paths For web: prompts user to select a file using File System Access API (modern browsers)
if serverUrls is null, the userServerList is fetched from nostr.
if no serverUrls (param or nostr) are found, throws an error
serverMediaOptimisation is whether the server should optimise the media BUD-05, IMPORTANT: the server hash will be different
auth says which identity the upload may be attributed to, see
AuthPolicy.
Implementation
Stream<BlobUploadProgress> uploadFromFile({
required String filePath,
List<String>? serverUrls,
String? contentType,
UploadStrategy strategy = UploadStrategy.mirrorAfterSuccess,
bool serverMediaOptimisation = false,
AuthPolicy? auth,
}) {
return _blossom.uploadBlobFromFile(
filePath: filePath,
serverUrls: serverUrls,
contentType: contentType,
strategy: strategy,
serverMediaOptimisation: serverMediaOptimisation,
auth: auth,
);
}