[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
}