         //[result appendData:[[[NSString alloc] initWithFormat:@"Content-Disposition: form-data; name=\"%@\"; filename=\"%@\"\r\n", parameter, fileName] dataUsingEncoding:NSUTF8StringEncoding]];
         
         autoreleasepool {
-            let contentType     = "Content-Type: application/octet-stream\r\n\r\n";
-            let contentTypeData = contentType.dataUsingEncoding(NSUTF8StringEncoding)!
+            let contentTypeStr  = contentType ?? "application/octet-stream"
+            let contentTypeSrv  = "Content-Type: \(contentTypeStr)\r\n\r\n";
+            let contentTypeData = contentTypeSrv.dataUsingEncoding(NSUTF8StringEncoding)!
             fwrite(contentTypeData.bytes, 1, contentTypeData.length, file)
         }
         //[result appendData:[@"Content-Type: application/octet-stream\r\n\r\n" dataUsingEncoding:NSUTF8StringEncoding]];

        }
        //[result appendData:[[[NSString alloc] initWithFormat:@"\r\n--%@\r\n",boundary] dataUsingEncoding:NSUTF8StringEncoding]];
        
        autoreleasepool {
            
            let formData = self.formDataForParams(boundary, dictWithParam: dictWithParam, ending: "\r\n")
            fwrite(formData.bytes, 1, formData.length, file)
        }
        
        fclose(file)

    }
    
    public class func tmpFileForUploadStreamWithDataForFilePath(
        dataFilePath : String,
        boundary     : String,
        name         : String,
        fileName     : String,
        contentType  : String?,
        dictWithParam: [String:String]?) -> String
    {
        var filePath = NSUUID().UUIDString
        
