             }
         }
         
+        request.timeoutInterval = 60 * 5
         request.setValue("Bearer \(MMCoreConfiguration.serviceAdapter.HATToken)", forHTTPHeaderField: "Authorization")
-        let uploadTask = MMCoreConfiguration.serviceAdapter.backgroundSessionManager.uploadTaskWithStreamedRequest(request, progress: nil) { response, responseObject, error in
+        
+        let uploadTask = MMCoreConfiguration.serviceAdapter.backgroundSessionManager.uploadTaskWithStreamedRequest(request, progress:&progress) { response, responseObject, error in
             if let e = error {
                 failure?(error: e)
             } else {

    }
    
    static public func download(attachmentID: String, userID userIdentifier: String?, success: ((NSURL) -> ())?, failure: ((error: NSError) -> Void)?) {
        var userIDQueryParam = ""
        if let userID = userIdentifier {
            userIDQueryParam = "?user_id=\(userID)"

@objc public class MMAttachmentService: NSObject {
    
    static public func upload(attachments: [MMAttachment], metaData:[String: String]?, success: (() -> ())?, failure: ((error: NSError) -> Void)?) {
        var progress : NSProgress? = nil
        upload(attachments, metaData: metaData, progress: &progress, success: success, failure: failure)
    }
    
    static public func upload(attachments: [MMAttachment], metaData:[String: String]?, inout progress : NSProgress?, success: (() -> ())?, failure: ((error: NSError) -> Void)?) {
        guard let uploadURL = NSURL(string: "com.magnet.server/file/save/multiple", relativeToURL: MMCoreConfiguration.serviceAdapter.endPoint.URL)?.absoluteString else {
            fatalError("uploadURL should not be nil")
        }
