I'm using AWS S3 Storage with Amplify and to avoid multiple uploads of the same file i want to check if the file already exists.
Currently by getting the download url via Amplify but it also generates an url if the file doesn't exists. I was hoping it returns an error:
_ = Amplify.Storage.getURL(key: "myKey") { event in
switch event {
case let .success(url):
print("Completed: \(url)")
case let .failure(storageError):
print("Failed: \(storageError.errorDescription). \(storageError.recoverySuggestion)")
}
}
Are there any other ways to check if files exists in amplify?
Without downloading it of course. The whole point is to save traffic.