update static method

Future<String> update(
  1. String oldFileUrl,
  2. UploadedFile newFile, {
  3. String subdirectory = '',
})

Replaces an old file with a new uploaded file.

Deletes the existing file (if it exists) and saves the new file.

oldFileUrl - The public URL of the file to replace. newFile - The UploadedFile object for the new file. subdirectory - Optional subdirectory for the new file.

Returns the public URL of the new file.

Implementation

static Future<String> update(String oldFileUrl, UploadedFile newFile,
    {String subdirectory = ''}) async {
  await delete(oldFileUrl);
  return await create(newFile, subdirectory: subdirectory);
}