Git Product home page Git Product logo

play-res's People

Contributors

futaz avatar ggrossetie avatar leon avatar rayronvictor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

play-res's Issues

Error using Res.put() with MultipartFormData

when i try to use the file from the MultiFormData, I get following error:

overloaded method value put with alternatives: (x$1: play.mvc.Http.MultipartFormData.FilePart)String (x
$1: java.io.File)String cannot be applied to
(play.api.mvc.MultipartFormData.FilePart[play.api.libs.Files.TemporaryFile])

it's because I get play.api.mvc.MultipartFormData.FilePart[play.api.libs.Files.TemporaryFile] from the request.body, but Res.put() expects play.mvc.Http.MultipartFormData.FilePart.

Do I use it wrong or is it a versioning error (play! 2.1.3, play-res 1.0, scala 2.10.0)?

this is my code:

def upload = Action { implicit request =>
    val file = for {
        body <- request.body.asMultipartFormData
        uploaded <- body.file("file")
    } yield uploaded

    file match {
        case Some(f) => {
            val id: String = Res.put(f)
            Ok(Json.obj("url" -> id))
        }
        case _ => BadRequest(Json.obj("error" -> "upload_error"))
    }
}

Res.put fails on FileUtils.movefile

I am using play-scalr for resizing images, Image upload fails on when I do Res.put with following exceptions
https://gist.github.com/pankajmi/7611800

This works fine on Mac though. I change the tmp folder on windows thinking it could be folder permission issue, but I find the same problem. I check the java process through process monitor and somewhere it says file is locked.
Process monitor log -

12:20:53.2390538 PM java.exe 4016 CreateFileMapping C:\Users\varsha agrawal\AppData\Local\Temp\multipartBody8496473752295517185asTemporaryFile FILE LOCKED WITH ONLY READERS SyncType: SyncTypeCreateSection, PageProtection: PAGE_READONLY

Can you help me here ?
I have stackoverflow link that I opened today -
http://stackoverflow.com/questions/20159290/apche-commons-movefile-method-fails-in-windows

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.