mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-08 22:45:51 +01:00
(refs #12) Implemented the process of saving image.
This commit is contained in:
@@ -25,7 +25,7 @@ class FileUploadController extends ScalatraServlet with FileUploadSupport {
|
||||
|
||||
post("/image/:owner/:repository"){
|
||||
execute { (file, fileId) =>
|
||||
|
||||
FileUtils.writeByteArrayToFile(new java.io.File(getAttachedDir(params("owner"), params("repository")), fileId), file.get)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -274,8 +274,7 @@ trait IssuesControllerBase extends ControllerBase {
|
||||
})
|
||||
|
||||
get("/:owner/:repository/_attached/:file")(referrersOnly { repository =>
|
||||
println("----" + params("file"))
|
||||
|
||||
new java.io.File(Directory.getAttachedDir(repository.owner, repository.name), params("file"))
|
||||
})
|
||||
|
||||
val assignedUserName = (key: String) => params.get(key) filter (_.trim != "")
|
||||
|
||||
Reference in New Issue
Block a user