mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Use the maxUploadSize in the media upload screen. (#4359)
* Fix a bug where some files sizes were sent as 0. * Make FileManger.sizeForItem(at:) a UInt. The docs specifically say that FileAttributeKey.size returns an unsigned long long so I have no idea why we were returning a Double here… * Add the maxMediaUploadSize property on ClientProxy. * Use the maxUploadSize to set a target video size and to show a file too big error. * Refactor media upload parameter order.
This commit is contained in:
@@ -49,10 +49,10 @@ extension FileManager {
|
||||
/// Retrieve a file's disk size
|
||||
/// - Parameter url: the file URL
|
||||
/// - Returns: the size in bytes
|
||||
func sizeForItem(at url: URL) throws -> Double {
|
||||
let attributes = try attributesOfItem(atPath: url.path())
|
||||
func sizeForItem(at url: URL) throws -> UInt {
|
||||
let attributes = try attributesOfItem(atPath: url.path(percentEncoded: false))
|
||||
|
||||
guard let size = attributes[FileAttributeKey.size] as? Double else {
|
||||
guard let size = attributes[FileAttributeKey.size] as? UInt else {
|
||||
throw FileManagerError.invalidFileSize
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user