title: Download file to Folder in iPhone
body: <p>I am new to iPhone, </p>
  
  <p>I made app in which, when user downloads anything it gets downloaded into <code>DocumentDirectory</code> </p>
  
  <p>I wants downloading inside my folder which i have created in <code>DocumentDirectory</code> </p>
  
  <p><strong>How to achieve this ?</strong></p>
  
  <p>I thought I will download file to my <code>DocumentDirectory</code> and i will move that file to my folder inside <code>DocumentDirectory</code>.</p>
  
  <p><strong><em>Is it good practice ?</em></strong> </p>
  
  <p><strong>Here is my code snippet,</strong> But still i am unable to move my file.</p>
  
  <pre><code>- (BOOL)webView:(UIWebView*)webView shouldStartLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType {
  
      NSString *file = [NSString stringWithString:[url absoluteString]];
      NSURL *fileURL = [NSURL URLWithString:file];
  
      NSURLRequest *req = [NSURLRequest requestWithURL:fileURL];
      [NSURLConnection connectionWithRequest:req delegate:self];
  
  
      NSString *DestPath=[[[SourcePath stringByAppendingString:@"/"]stringByAppendingString:BookCateg]stringByAppendingString:@"/"];
  
                     if ([fm copyItemAtPath:SourcePath toPath:DestPath error:&amp;error]) 
                     {
                        NSLog(@"Success !");
                     }
                    else{
                        NSLog(@"Fail to Move!");
                     }
  
  }
  </code></pre>
  
  <p>My log shows <code>Fail to Move!</code></p>
  
  <p><strong>Any help will be appreciated.</strong></p>