uploadFromFolder method

Future<List<FileUploadResult>> uploadFromFolder(
  1. String folderPath,
  2. IFileUploadRequest? params
)

Uploads files inside a local folder via path. @param folderPath Path to the folder to upload. @param {IFileUploadRequest} params - Optional parameters to be used for uploading files @returns List of uploaded files with their properties

Implementation

Future<List<FileUploadResult>> uploadFromFolder(
    String folderPath, IFileUploadRequest? params) async {
  final temp =
      await file_utils.uploadFiles(folderPath, apiPrefix!, params, null);

  if (params?.awaitCid == false) {
    return temp.files;
  }

  return await resolveFileCIDs(temp.sessionUuid, temp.files.length);
}