File
open class File: NSObject
                Represents a file on Put.io
- 
                  
                  
The file ID
Declaration
Swift
open dynamic var id: Int = 0 - 
                  
                  
The display name of the file
Declaration
Swift
open dynamic var name: String? - 
                  
                  
The size of the file in bytes
Declaration
Swift
open dynamic var size: Int = 0 - 
                  
                  
The metatype of file
Declaration
Swift
open dynamic var contentType: String? - 
                  
                  
Does the file have an MP4?
Declaration
Swift
open dynamic var hasMP4 = false - 
                  
                  
The ID of the parent folder (if there is one)
Declaration
Swift
open dynamic var parentID: Int = 0 - 
                  
                  
Whether the file has been access or not
Declaration
Swift
open dynamic var accessed = false - 
                  
                  
URL string of a screenshot
Declaration
Swift
open dynamic var screenshot: String? - 
                  
                  
Whether the file has been shared with you or if you own it
Declaration
Swift
open dynamic var isShared = false - 
                  
                  
Seconds that the file should be started from
Declaration
Swift
open dynamic var startFrom: Double = 0 - 
                  
                  
Reference to parent file
Declaration
Swift
open dynamic var parent: File? - 
                  
                  
The timestamp when the file was created
Declaration
Swift
open dynamic var createdAt: String? - 
                  
                  
Link to an HLS playlist that allows for streaming on Apple devices easily
Declaration
Swift
public var hlsPlaylist: String? - 
                  
                  
Whether the file is a directory or not
Declaration
Swift
public var isDirectory: Bool 
- 
                  
                  
Rename the selected file
- Parameters:
- name: The new name of the file
 - completionHandler: The response handler
 
 
Declaration
Swift
public func rename(name: String, completionHandler: @escaping (Bool) -> Void)Parameters
nameThe new name of the file
completionHandlerThe response handler
 - Parameters:
 - 
                  
                  
Get the current progress of the file
Parameter
Parameter completionHandler: The response handlerDeclaration
Swift
public func getProgress(completionHandler: @escaping (Int) -> Void)Parameters
completionHandlerThe response handler
 - 
                  
                  
Convert the request file to MP4
Parameter
Parameter completionHandler: The response handlerDeclaration
Swift
public func convertToMp4(completionHandler: @escaping (Bool) -> Void)Parameters
completionHandlerThe response handler
 - 
                  
                  
Get the current MP4 status for a file.
Parameter
Parameter completionHandler: The response handlerDeclaration
Swift
public func getMp4Status(completionHandler: @escaping (MP4Status, Int) -> Void)Parameters
completionHandlerThe response handler
 - 
                  
                  
Share the file with friends
- Parameters:
- friends: Array of friend usernames
 - completionHandler: The response handler
 
 
Declaration
Swift
public func share(with friends: [String], completionHandler: @escaping (Bool) -> Void)Parameters
friendsArray of friend usernames
completionHandlerThe response handler
 - Parameters:
 - 
                  
                  
Unshare the file with the selected friends
- Parameters:
- with: Array of friends
 - completionHandler: The response handler
 
 
Declaration
Swift
public func unshare(with friends: [Friend], completionHandler: @escaping (Bool) -> Void)Parameters
withArray of friends
completionHandlerThe response handler
 - Parameters:
 - 
                  
                  
Delete the current file
Parameter
Parameter completionHandler: The response handlerDeclaration
Swift
public func delete(completionHandler: @escaping (Bool) -> Void)Parameters
completionHandlerThe response handler
 - 
                  
                  
Move the current file to a new parent folder
- Parameters:
- to: ID of the new parent directory
 - completionHandler: The response handler
 
 
Declaration
Swift
public func move(to: Int, completionHandler: @escaping (Bool) -> Void)Parameters
toID of the new parent directory
completionHandlerThe response handler
 - Parameters:
 - 
                  
                  
Get the friends that a file has been shared with
Parameter
Parameter completionHandler: The response handlerDeclaration
Swift
public func getSharedWith(completionHandler: @escaping ([Friend], Error?) -> Void)Parameters
completionHandlerThe response handler
 - 
                  
                  
Set the video position
- Parameters:
- position: The time in seconds
 - completionHandler: The response handler
 
 
Declaration
Swift
public func setVideo(position: Int, completionHandler: @escaping (Bool) -> Void)Parameters
positionThe time in seconds
completionHandlerThe response handler
 - Parameters:
 - 
                  
                  
Delete the video position
Parameter
Parameter completionHandler: The response handlerDeclaration
Swift
public func deleteVideoPosition(completionHandler: @escaping (Bool) -> Void)Parameters
completionHandlerThe response handler
 
      File Class Reference