Skip to content

Commit

Permalink
fix(IOS): fix fileUrl part 1
Browse files Browse the repository at this point in the history
  • Loading branch information
WcaleNieWolny committed Sep 4, 2024
1 parent afb1c25 commit 328a3bf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ios/Sources/UploaderPlugin/Uploader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ import MobileCoreServices
request.setValue(value, forHTTPHeaderField: key)
}

let fileUrl = URL(fileURLWithPath: filePath)
guard let fileUrl = URL(string: filePath) else {
throw NSError(domain: "UploaderPlugin", code: 1, userInfo: [NSLocalizedDescriptionKey: "Invalid file URL"])
}
let mimeType = options["mimeType"] as? String ?? guessMIMEType(from: filePath)

let task: URLSessionTask
Expand Down

0 comments on commit 328a3bf

Please sign in to comment.