mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-13 08:55:50 +01:00
Change a path for uploading a file
This commit is contained in:
@@ -23,7 +23,7 @@ class FileUploadController extends ScalatraServlet with FileUploadSupport {
|
|||||||
}, FileUtil.isImage)
|
}, FileUtil.isImage)
|
||||||
}
|
}
|
||||||
|
|
||||||
post("/image/:owner/:repository"){
|
post("/file/:owner/:repository"){
|
||||||
execute({ (file, fileId) =>
|
execute({ (file, fileId) =>
|
||||||
FileUtils.writeByteArrayToFile(new java.io.File(
|
FileUtils.writeByteArrayToFile(new java.io.File(
|
||||||
getAttachedDir(params("owner"), params("repository")),
|
getAttachedDir(params("owner"), params("repository")),
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
$(function(){
|
$(function(){
|
||||||
try {
|
try {
|
||||||
$([$('#@textareaId').closest('div')[0], $('#@textareaId').next('div')[0]]).dropzone({
|
$([$('#@textareaId').closest('div')[0], $('#@textareaId').next('div')[0]]).dropzone({
|
||||||
url: '@path/upload/image/@owner/@repository',
|
url: '@path/upload/file/@owner/@repository',
|
||||||
maxFilesize: 10,
|
maxFilesize: 10,
|
||||||
acceptedFiles: 'image/*,application/pdf',
|
acceptedFiles: 'image/*,application/pdf',
|
||||||
dictInvalidFileType: 'Unfortunately, we don\'t support that file type. Try again with a PNG, GIF, or JPG.',
|
dictInvalidFileType: 'Unfortunately, we don\'t support that file type. Try again with a PNG, GIF, or JPG.',
|
||||||
|
|||||||
Reference in New Issue
Block a user