title: NSURLSession Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"
body: <p>I am downloading the file in background using NSURLSession background session configuration.</p>
  
  <pre><code>- (void)initBackgroundSession {
  
      self.backgroundSessionManager = [NSURLSession sessionWithConfiguration:[NSURLSessionConfiguration backgroundSessionConfigurationWithIdentifier:IELBackgroundSesssionCourseDownload] delegate:self delegateQueue:[NSOperationQueue mainQueue]];
  
      [self updateCurrentDownloadingCourse];
      self.isSuspendcourseDownloadTask = false;
  }
  
  - (void)updateCurrentDownloadingCourse {
  
  [_backgroundSessionManager getTasksWithCompletionHandler:^(NSArray&lt;NSURLSessionDataTask *&gt; * _Nonnull dataTasks, NSArray&lt;NSURLSessionUploadTask *&gt; * _Nonnull uploadTasks, NSArray&lt;NSURLSessionDownloadTask *&gt; * _Nonnull downloadTasks) {
  
      NSLog(@"Count of DownloadTask %lu",(unsigned long)downloadTasks.count);
      for (NSURLSessionDownloadTask *downloadTask in downloadTasks) {
  
              NSDictionary *customDescription = [downloadTask getCustomTaskDescription];
              NSString *courseId = customDescription[IELCourseJSONKeyCoureID];
              if (courseId) {
  
                  [self setDownloadingCourse_id:courseId];
                  [self setCourseDownloadTask:downloadTask];
                  break;
              }
  
              [downloadTask resume];
      }
  }];
  }
  </code></pre>
  
  <p>Now the issue is if a download is in progress and i close the application from background by pressing home button twice. And then if i reopen the application. Then all download starts failing with given below error message. If i re-add a download task in the NSURLSession object even then it fails till i close application from background and reopen the application.</p>
  
  <pre><code>- (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didCompleteWithError:(NSError *)error 
  
  
  Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory" UserInfo={NSErrorFailingURLKey=https://ilmsdevqa.inspiredlms.com/Content/Organizations/1544/ScormCourses/offline/2970-offline.zip, NSErrorFailingURLStringKey=https://ilmsdevqa.inspiredlms.com/Content/Organizations/1544/ScormCourses/offline/2970-offline.zip}
  </code></pre>