Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def upload = Action(parse.maxLength(Math.pow(1024, 3).intValue, parse.multipartFormData)) { implicit req ⇒
- req.body match {
- case Left(MaxSizeExceeded(length)) => NotAcceptable
- case Right(multipartForm) =>
- multipartForm.file("videoFile").map { tmpFile: FilePart[play.api.libs.Files.TemporaryFile] ⇒
- userid(req) match {
- case Some(advisor) ⇒
- CDNUpload.push(advisor, new ObjectId, tmpFile) match {
- case Right((file, target, video)) ⇒
- Ok(Json.obj("video" -> video))
- case Left(msg) ⇒ BadRequest(Messages("video.upload.error"))
- }
- case _ ⇒ Unauthorized
- }
- } getOrElse BadRequest
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement