0

During downloading I get url successfully but following error while uploading

2022-02-10 23:50:56.154941-0800 QuranApp[2202:419266] CFURLResourceIsReachable failed because it was passed a URL which has no scheme
Optional(Error Domain=FIRStorageErrorDomain Code=-13000 "File at URL: /Users/apple/Downloads/arabic.pdf is not reachable. Ensure file URL is not a directory, symbolic link, or invalid url." UserInfo={NSLocalizedDescription=File at URL: /Users/apple/Downloads/arabicquran.pdf is not reachable. Ensure file URL is not a directory, symbolic link, or invalid url., NSUnderlyingError=0x282b187b0 {Error Domain=NSCocoaErrorDomain Code=262 "The file couldn’t be opened because the specified URL type isn’t supported."}})

Code

 let url = URL(string: "/Users/apple/Downloads/arabicquran.pdf")
        
          let fileextension = url?.pathExtension
          let filename = "testing.\(fileextension)"
          
         self.storage.child("QuranURL/\(filename)").putFile(from: url!, metadata: nil,completion: {url, error in
             
             guard error == nil else {
                 print("No URl uploaded : \(error)")
                 return
             }
            
              print("Uploaded : \(url)")

            })
udi
  • 3,672
  • 2
  • 12
  • 33

0 Answers0