[NSURLConnectionsendAsynchronousRequest:requestqueue:[[NSOperationQueuealloc]init]completionHandler:^(NSURLResponse*_Nullableresponse,NSData*_Nullabledata,NSError*_NullableconnectionError) {
//出错则返回
if(connectionError !=nil) {
NSLog(@"connectionError = %@",connectionError);
return;
}else{
//通过NSURLResponse类来获取文件的类型
NSLog(@"%@",response.MIMEType);//获取文件的类型如:text/plain
NSLog(@"%@",response.suggestedFilename);//获取文件名加后缀如:LOG_20170115100747.txt
}