我从重写的 url 下载 pdf 文件,所以我无法从 url 获取文件名。我怎么才能得到它 ?
我当前的代码:
NSString *documentsDirectory = [NSHomeDirectory()
stringByAppendingPathComponent:@"Documents"];
NSString *filePath = [documentsDirectory stringByAppendingPathComponent:@"Document.pdf"];
//url rewrited: downloadUrl = http://mySite/pdf/2020?pointer=451&Entity=4
NSData *pdfData = [NSData dataWithContentsOfURL:downloadUrl];
[pdfData writeToFile:filePath atomically:YES];