|
|
@@ -373,6 +373,7 @@
|
|
|
PHFetchResult *fetchResult = [PHAsset fetchAssetsWithLocalIdentifiers:@[curLocalIdentifier] options:nil];
|
|
|
PHAsset *asset = fetchResult.firstObject;
|
|
|
operation.fileModel.asset = asset;
|
|
|
+ operation.fileModel.assetTimerStr = [iTools convertToBeijingTimeString:asset.creationDate];
|
|
|
}
|
|
|
|
|
|
PHImageRequestOptions *options = [[PHImageRequestOptions alloc] init];
|
|
|
@@ -435,6 +436,7 @@
|
|
|
PHFetchResult *fetchResult = [PHAsset fetchAssetsWithLocalIdentifiers:@[curLocalIdentifier] options:nil];
|
|
|
PHAsset *asset = fetchResult.firstObject;
|
|
|
operation.fileModel.asset = asset;
|
|
|
+ operation.fileModel.assetTimerStr = [iTools convertToBeijingTimeString:asset.creationDate];
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -756,6 +758,12 @@
|
|
|
*/
|
|
|
[request setValue:[NSString stringWithFormat:@"multipart/form-data; charset=utf-8; boundary=%@", Kboundary2] forHTTPHeaderField:@"Content-Type"];
|
|
|
|
|
|
+ NSString *creationDate = dataModel.assetTimerStr;
|
|
|
+ if (creationDate && params
|
|
|
+ && [params isKindOfClass:[NSMutableDictionary class]]) {
|
|
|
+ [params setValue:creationDate forKey:@"fileTime"];
|
|
|
+ }
|
|
|
+
|
|
|
/// body
|
|
|
NSMutableData *boydData = [NSMutableData data];
|
|
|
// 2.1 边界符号(开始边界)
|
|
|
@@ -794,7 +802,7 @@
|
|
|
|
|
|
|
|
|
NSString *serverFileName = dataModel.filename; //name
|
|
|
-
|
|
|
+ //NSString *creationDate = dataModel.assetTimerStr;
|
|
|
|
|
|
// filename已命名文件; name相当于一个key, 这个名字和服务器保持一致
|
|
|
/*
|
|
|
@@ -802,7 +810,8 @@
|
|
|
*/
|
|
|
//2.3 拼接数据(创建一个字符串来拼装)
|
|
|
NSMutableString *string = [NSMutableString new];
|
|
|
- [string appendFormat:@"Content-Disposition:form-data; name=\"%@\"; filename=\"%@\" ", @"file", serverFileName];
|
|
|
+ [string appendFormat:@"Content-Disposition:form-data; name=\"%@\"; filename=\"%@\"; ", @"file", serverFileName];
|
|
|
+ //[string appendFormat:@"Content-Disposition:form-data; name=\"%@\"; filename=\"%@\"; fileTime=\"%@\" ", @"file", serverFileName,creationDate];
|
|
|
//[string appendFormat:@"%@", KNewLine];
|
|
|
[string appendFormat:@"\r\n"];
|
|
|
[string appendFormat:@"Content-Type:%@", serverContentTypes];
|