uploadFromFile method

Stream<BlobUploadProgress> uploadFromFile({
  1. required String filePath,
  2. List<String>? serverUrls,
  3. String? contentType,
  4. UploadStrategy strategy = UploadStrategy.mirrorAfterSuccess,
  5. bool serverMediaOptimisation = false,
})

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 \

Implementation

Stream<BlobUploadProgress> uploadFromFile({
  required String filePath,
  List<String>? serverUrls,
  String? contentType,
  UploadStrategy strategy = UploadStrategy.mirrorAfterSuccess,
  bool serverMediaOptimisation = false,
}) {
  return _blossom.uploadBlobFromFile(
    filePath: filePath,
    serverUrls: serverUrls,
    contentType: contentType,
    strategy: strategy,
    serverMediaOptimisation: serverMediaOptimisation,
  );
}