|
29 | 29 | #import "PFUserPrivate.h" |
30 | 30 | #import "Parse_Private.h" |
31 | 31 |
|
32 | | -static const unsigned long long PFFileMaxFileSize = 10 * 1024 * 1024; // 10 MB |
33 | | - |
34 | 32 | @interface PFFile () { |
35 | 33 | dispatch_queue_t _synchronizationQueue; |
36 | 34 | } |
@@ -84,19 +82,6 @@ + (instancetype)fileWithName:(NSString *)name contentsAtPath:(NSString *)path er |
84 | 82 | return nil; |
85 | 83 | } |
86 | 84 |
|
87 | | - NSDictionary *attributes = [fileManager attributesOfItemAtPath:path error:nil]; |
88 | | - unsigned long long length = [attributes[NSFileSize] unsignedLongValue]; |
89 | | - if (length > PFFileMaxFileSize) { |
90 | | - NSString *message = [NSString stringWithFormat:@"Failed to create PFFile at path '%@': file is larger than %lluMB.", |
91 | | - path, (PFFileMaxFileSize >> 20)]; |
92 | | - if (error) { |
93 | | - *error = [NSError errorWithDomain:NSCocoaErrorDomain |
94 | | - code:NSFileReadTooLargeError |
95 | | - userInfo:@{ NSLocalizedDescriptionKey : message }]; |
96 | | - } |
97 | | - return nil; |
98 | | - } |
99 | | - |
100 | 85 | PFFile *file = [self fileWithName:name url:nil]; |
101 | 86 | if (![file _stageWithPath:path error:error]) { |
102 | 87 | return nil; |
@@ -127,17 +112,6 @@ + (instancetype)fileWithName:(NSString *)name |
127 | 112 | return nil; |
128 | 113 | } |
129 | 114 |
|
130 | | - if (data.length > PFFileMaxFileSize) { |
131 | | - NSString *message = [NSString stringWithFormat:@"Failed to create PFFile with data: data is larger than %lluMB.", |
132 | | - (PFFileMaxFileSize >> 20)]; |
133 | | - if (error) { |
134 | | - *error = [NSError errorWithDomain:NSCocoaErrorDomain |
135 | | - code:NSFileReadTooLargeError |
136 | | - userInfo:@{ NSLocalizedDescriptionKey : message }]; |
137 | | - } |
138 | | - return nil; |
139 | | - } |
140 | | - |
141 | 115 | PFFile *file = [[self alloc] initWithName:name urlString:nil mimeType:contentType]; |
142 | 116 | if (![file _stageWithData:data error:error]) { |
143 | 117 | return nil; |
|
0 commit comments