uploadFile method

  1. @Deprecated('Use [uploadResource] instead')
Future<CloudinaryResponse> uploadFile({
  1. String? filePath,
  2. List<int>? fileBytes,
  3. String? publicId,
  4. String? fileName,
  5. String? folder,
  6. CloudinaryResourceType? resourceType,
  7. Map<String, dynamic>? optParams,
  8. ProgressCallback? progressCallback,
})

Uploads a file of resourceType with fileName to a folder in your specified cloudName

filePath path to the file to upload fileBytes byte array of the file to uploaded resourceType defaults to CloudinaryResourceType.auto fileName is not mandatory, if not specified then a random name will be used optParams a Map of optional parameters as defined in https://cloudinary.com/documentation/image_upload_api_reference

Response: Check all the attributes in the CloudinaryResponse to get the information you need... including secureUrl, publicId, etc.

Implementation

@Deprecated('Use [uploadResource] instead')
Future<CloudinaryResponse> uploadFile({
  String? filePath,
  List<int>? fileBytes,
  String? publicId,
  String? fileName,
  String? folder,
  CloudinaryResourceType? resourceType,
  Map<String, dynamic>? optParams,
  ProgressCallback? progressCallback,
}) =>
    uploadResource(CloudinaryUploadResource(
      filePath: filePath,
      fileBytes: fileBytes,
      publicId: publicId,
      fileName: fileName,
      folder: folder,
      resourceType: resourceType,
      optParams: optParams,
      progressCallback: progressCallback,
    ));