Upload video file to server
<p>I have uploaded video file to server but the file size is zero.</p>

<pre><code>let url:NSURL? = NSURL(string: (Config.sampleuploadurl as String)+"/uploadServlet?chehara_email=\(candit_email)")
// let url:NSURL? = NSURL(string: (Config.apiUrl as String)+"/UploadServlet?chehara_email=\(candit_email)")
print(url)
let cachePolicy = NSURLRequestCachePolicy.ReloadIgnoringLocalCacheData
var request = NSMutableURLRequest(URL: url!, cachePolicy: cachePolicy, timeoutInterval: 2.0)
request.HTTPMethod = "POST"
let boundaryConstant = "Boundary-7MA4YWxkTLLu0UIW"; // This should be auto-generated.
let contentType = "multipart/form-data; boundary=" + boundaryConstant

let fileName:String = videoName

let mimeType = "text/MOV"
let fieldName = "uploadFile"

request.setValue(contentType, forHTTPHeaderField: "Content-Type")

var error: NSError?
var dataString = "--\(boundaryConstant)\r\n"

dataString += "Content-Disposition: form-data; name=\"\(fieldName)\"; filename=\"\(fileName)\"\r\n"
print("dataString")

dataString += "Content-Type: \(mimeType)\r\n\r\n"
print(dataString)

dataString += String(contentsOfFile: videoName, encoding: NSUTF8StringEncoding, error: &amp;error)!   // This is Error Line

dataString += "\r\n"
dataString += "--\(boundaryConstant)--\r\n"

let requestBodyData = (dataString as NSString).dataUsingEncoding(NSUTF8StringEncoding)
print("Request")
print(requestBodyData)

request.HTTPBody = requestBodyData
print(request.HTTPBody)

})
</code></pre>

<p>I refer this <a href="https://gist.github.com/janporu-san/e832cdee51974fc55660" rel="nofollow">tutorial</a>.</p>