File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -216,7 +216,7 @@ - (void)exportAssert {
216216 resource = assetRes;
217217 }
218218 }
219- NSString *fileName = [NSString stringWithFormat: @" tempAsset-%lf .mov" , [[NSDate date ] timeIntervalSince1970 ]];
219+ NSString *fileName = [NSString stringWithFormat: @" tempAsset-%f - %d .mov" , [[NSDate date ] timeIntervalSince1970 ], arc4random ()% 100000 ];
220220 PHAssetResourceRequestOptions *options = [PHAssetResourceRequestOptions new ];
221221 // 不支持icloud上传
222222 options.networkAccessAllowed = NO ;
Original file line number Diff line number Diff line change @@ -109,7 +109,8 @@ - (void)getInfo {
109109 _hasGotInfo = YES ;
110110 NSConditionLock *assetReadLock = [[NSConditionLock alloc ] initWithCondition: kAMASSETMETADATA_PENDINGREADS ];
111111
112- NSString *pathToWrite = [NSTemporaryDirectory () stringByAppendingString: self .phAssetResource.originalFilename];
112+ NSString *fileName = [NSString stringWithFormat: @" tempAsset-%f -%d .mov" , [[NSDate date ] timeIntervalSince1970 ], arc4random ()%100000 ];
113+ NSString *pathToWrite = [NSTemporaryDirectory () stringByAppendingString: fileName];
113114 NSURL *localpath = [NSURL fileURLWithPath: pathToWrite];
114115 PHAssetResourceRequestOptions *options = [PHAssetResourceRequestOptions new ];
115116 options.networkAccessAllowed = YES ;
@@ -147,7 +148,8 @@ - (NSData *)fetchDataFromAsset:(PHAssetResource *)videoResource error:(NSError *
147148
148149 NSConditionLock *assetReadLock = [[NSConditionLock alloc ] initWithCondition: kAMASSETMETADATA_PENDINGREADS ];
149150
150- NSString *pathToWrite = [NSTemporaryDirectory () stringByAppendingString: videoResource.originalFilename];
151+ NSString *fileName = [NSString stringWithFormat: @" tempAsset-%f -%d .mov" , [[NSDate date ] timeIntervalSince1970 ], arc4random ()%100000 ];
152+ NSString *pathToWrite = [NSTemporaryDirectory () stringByAppendingString: fileName];
151153 NSURL *localpath = [NSURL fileURLWithPath: pathToWrite];
152154 PHAssetResourceRequestOptions *options = [PHAssetResourceRequestOptions new ];
153155 options.networkAccessAllowed = YES ;
You can’t perform that action at this time.
0 commit comments