         self.url = url
         self.fileName = name
         self.mimeType = "application/octet-stream"
-        if mimeType != nil {
-            self.mimeType = mimeType!
+        if let mimeType = mimeType {
+            self.mimeType = mimeType
         }
         if let _name = url.lastPathComponent {
             fileName = _name
         }
-        if mimeType == nil, let _extension = url.pathExtension {
+        if let mimeType = mimeType, let _extension = url.pathExtension {
             switch _extension.lowercaseString {
-                
             case "jpeg", "jpg":
                 self.mimeType = "image/jpeg"
                 

//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
//  THE SOFTWARE.
//  Largely based on this stackoverflow question: http://stackoverflow.com/questions/26121827/uploading-file-with-parameters-using-alamofire/28467829//

import Foundation
import Alamofire

            data.appendData( "\r\n--\(boundary)\r\n".dataUsingEncoding(NSUTF8StringEncoding)! )
            data.appendData( "Content-Disposition: form-data; name=\"\(fileUploadInfo.name)\"; filename=\"\(fileUploadInfo.fileName)\"\r\n".dataUsingEncoding(NSUTF8StringEncoding)!)
            data.appendData( "Content-Type: \(fileUploadInfo.mimeType)\r\n\r\n".dataUsingEncoding(NSUTF8StringEncoding)!)
            if let fileData = fileUploadInfo.data {
                data.appendData( fileData )
            }
            else if let url = fileUploadInfo.url, let fileData = NSData(contentsOfURL: url) {
                data.appendData( fileData )
            }
            else { // ToDo: report error
