Change a path for uploading a file

This commit is contained in:
Yota Ichino
2015-10-12 20:56:39 +09:00
parent 98fc64deaa
commit 6accdefb8c
2 changed files with 2 additions and 2 deletions

View File

@@ -23,7 +23,7 @@ class FileUploadController extends ScalatraServlet with FileUploadSupport {
}, FileUtil.isImage)
}
post("/image/:owner/:repository"){
post("/file/:owner/:repository"){
execute({ (file, fileId) =>
FileUtils.writeByteArrayToFile(new java.io.File(
getAttachedDir(params("owner"), params("repository")),

View File

@@ -9,7 +9,7 @@
$(function(){
try {
$([$('#@textareaId').closest('div')[0], $('#@textareaId').next('div')[0]]).dropzone({
url: '@path/upload/image/@owner/@repository',
url: '@path/upload/file/@owner/@repository',
maxFilesize: 10,
acceptedFiles: 'image/*,application/pdf',
dictInvalidFileType: 'Unfortunately, we don\'t support that file type. Try again with a PNG, GIF, or JPG.',