@Rob thank you for your prompt replies and that helped me a lot. Here is my code that worked. Hope it helps someone. I am able to get the actual file name and move the file to my documents directory using the original name.
-(void) URLSession:(NSURLSession *)session downloadTask:(NSURLSessionDownloadTask *)downloadTask didFinishDownloadingToURL:(NSURL *)location
{
NSFileManager *fileManager = [NSFileManager defaultManager];
NSError *error;
//getting application's document directory path
NSArray * tempArray = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *docsDir = [tempArray objectAtIndex:0];
//adding a new folder to the documents directory path
NSString *appDir = [docsDir stringByAppendingPathComponent:@"/Reader/"];
//Checking for directory existence and creating if not already exists
if(![fileManager fileExistsAtPath:appDir])
{
[fileManager createDirectoryAtPath:appDir withIntermediateDirectories:NO attributes:nil error:&error];
}
//retrieving the filename from the response and appending it again to the path
//this path "appDir" will be used as the target path
appDir = [appDir stringByAppendingFormat:@"/%@",[[downloadTask response] suggestedFilename]];
//checking for file existence and deleting if already present.
if([fileManager fileExistsAtPath:appDir])
{
NSLog([fileManager removeItemAtPath:appDir error:&error]?@"deleted":@"not deleted");
}
//moving the file from temp location to app's own directory
BOOL fileCopied = [fileManager moveItemAtPath:[location path] toPath:appDir error:&error];
NSLog(fileCopied ? @"Yes" : @"No");
}