mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-03 20:15:59 +01:00
Define session keys.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
package app
|
||||
|
||||
import util.FileUtil
|
||||
import _root_.util.{Keys, FileUtil}
|
||||
import util.ControlUtil._
|
||||
import org.scalatra._
|
||||
import org.scalatra.servlet.{MultipartConfig, FileUploadSupport}
|
||||
@@ -21,7 +21,7 @@ class FileUploadController extends ScalatraServlet
|
||||
fileParams.get("file") match {
|
||||
case Some(file) if(FileUtil.isImage(file.name)) => defining(generateFileId){ fileId =>
|
||||
FileUtils.writeByteArrayToFile(getTemporaryFile(fileId), file.get)
|
||||
session += "upload_" + fileId -> file.name
|
||||
session += Keys.Session.Upload(fileId) -> file.name
|
||||
Ok(fileId)
|
||||
}
|
||||
case None => BadRequest
|
||||
|
||||
Reference in New Issue
Block a user