title: Download PDF and save to the "Files" in iPhone, not to the app data, Swift
body: <p>I tried downloading pdf files with the below code. Here it's storing in the app data. But I need to show the downloaded pdf in <strong>"Files"</strong> folder in iPhone.</p>
  
  <pre><code>    // Create destination URL
      let documentsUrl:URL =  FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first as URL!
      let destinationFileUrl = documentsUrl.appendingPathComponent("downloadedFile.jpg")
  
      //Create URL to the source file you want to download
      let fileURL = URL(string: "http://swift-lang.org/guides/tutorial.pdf")
  
      let sessionConfig = URLSessionConfiguration.default
      let session = URLSession(configuration: sessionConfig)
  
      let request = URLRequest(url:fileURL!)
  
      let task = session.downloadTask(with: request) { (tempLocalUrl, response, error) in
          if let tempLocalUrl = tempLocalUrl, error == nil {
              // Success
              if let statusCode = (response as? HTTPURLResponse)?.statusCode {
                  print("Successfully downloaded. Status code: \(statusCode)")
              }
  
              do {
                  try FileManager.default.copyItem(at: tempLocalUrl, to: destinationFileUrl)
              } catch (let writeError) {
                  print("Error creating a file \(destinationFileUrl) : \(writeError)")
              }
  
          } else {
              print("Error took place while downloading a file. Error description: %@", error?.localizedDescription ?? "");
          }
      }
      task.resume()
  </code></pre>
  
  <p>Is it possible??</p>