com.jfinal.upload.UploadFile Java Examples

The following examples show how to use com.jfinal.upload.UploadFile. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: _AttachmentController.java    From jpress with GNU Lesser General Public License v3.0 5 votes vote down vote up
public void doUplaodRootFile() {
    if (!isMultipartRequest()) {
        renderError(404);
        return;
    }

    UploadFile uploadFile = getFile();
    if (uploadFile == null) {
        renderJson(Ret.fail().set("message", "请选择要上传的文件"));
        return;
    }

    File file = uploadFile.getFile();
    if (AttachmentUtils.isUnSafe(file)) {
        file.delete();
        renderJson(Ret.fail().set("message", "不支持此类文件上传"));
        return;
    }

    File rootFile = new File(PathKit.getWebRootPath(), file.getName());
    if (rootFile.exists()) {
        file.delete();
        renderJson(Ret.fail().set("message", "该文件已经存在,请手动删除后再重新上传。"));
        return;
    }

    try {
        FileUtils.moveFile(file, rootFile);
        rootFile.setReadable(true, false);
        renderOkJson();
        return;
    } catch (IOException e) {
        e.printStackTrace();
    }

    renderJson(Ret.fail().set("message", "系统错误。"));
}
 
Example #2
Source File: FileAPIController.java    From jfinal-api-scaffold with MIT License 5 votes vote down vote up
/**
 * 处理单文件或多文件上传,上传成功后,返回url集合
 */
public void upload(){
       if (!methodType("post")) {
           render404();
           return;
       }
       FileResponse response = new FileResponse();
	try {
		List<UploadFile> fileList = getFiles();//已接收到的文件
		if(fileList != null && !fileList.isEmpty()){
		    Map<String, String> urls = new HashMap<String, String>();//用于保存上传成功的文件地址
			List<String> failedFiles = new ArrayList<String>(); //用于保存未成功上传的文件名
               
               for(UploadFile uploadFile : fileList){
				File file=uploadFile.getFile();
                   String urlPath = FileUtils.saveUploadFile(file);
                   if (StringUtils.isEmpty(urlPath)) {
                       failedFiles.add(uploadFile.getParameterName());//标记为上传失败
                   } else {
                       //返回相对路径,用于响应
                       urls.put(uploadFile.getParameterName(), urlPath + file.getName());
                   }
			}
		    response.setDatum(urls);
		    if (failedFiles.size() > 0) {
		        response.setCode(Code.FAIL);//表示此次上传有未上传成功的文件
		        response.setFailed(failedFiles);
		    }
		}else{
			response.setCode(Code.ARGUMENT_ERROR).setMessage("uploadFileName can not be null");
		}
	} catch (Exception e) {
		e.printStackTrace();
		response.setCode(Code.ERROR);
	}
	renderJson(response);
}
 
Example #3
Source File: AttachmentUtils.java    From jpress with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * @param uploadFile
 * @return new file relative path
 */
public static String moveFile(UploadFile uploadFile) {
    if (uploadFile == null) {
        return null;
    }

    File file = uploadFile.getFile();
    if (!file.exists()) {
        return null;
    }

    File newfile = newAttachemnetFile(FileUtil.getSuffix(file.getName()));

    if (!newfile.getParentFile().exists()) {
        newfile.getParentFile().mkdirs();
    }

    try {
        org.apache.commons.io.FileUtils.moveFile(file, newfile);
        newfile.setReadable(true,false);
    } catch (IOException e) {
        LOG.error(e.toString(), e);
    }

    String attachmentRoot = JPressConfig.me.getAttachmentRootOrWebRoot();
    return FileUtil.removePrefix(newfile.getAbsolutePath(), attachmentRoot);
}
 
Example #4
Source File: _WordpressImport.java    From jpress with GNU Lesser General Public License v3.0 5 votes vote down vote up
public void doWordPressImport() {

        UploadFile ufile = getFile();
        if (ufile == null) {
            renderJson(Ret.fail("message", "您还未选择WordPress文件"));
            return;
        }

        if (!".xml".equals(FileUtil.getSuffix(ufile.getFileName()))) {
            renderJson(Ret.fail("message", "请选择从WordPress导出的XML文件"));
            return;
        }

        String newPath = AttachmentUtils.moveFile(ufile);
        File xmlFile = AttachmentUtils.file(newPath);

        WordPressXmlParser wordPressXmlParser = new WordPressXmlParser();
        wordPressXmlParser.parse(xmlFile);


        List<Article> contents = wordPressXmlParser.getArticles();
        if (ArrayUtil.isNotEmpty(contents)) {
            doSaveArticles(contents);
        }

        List<Attachment> attachments = wordPressXmlParser.getAttachments();
        if (ArrayUtil.isNotEmpty(attachments)) {
            doSaveAttachements(attachments);
        }

        renderOkJson();
    }
 
Example #5
Source File: _TemplateController.java    From jpress with GNU Lesser General Public License v3.0 5 votes vote down vote up
public void doUploadFile() {

        UploadFile uploadFile = getFile();
        String fileName = uploadFile.getFileName();
        String dirName = getPara("d").trim();

        //防止浏览非模板目录之外的其他目录
        render404If(dirName != null && dirName.contains(".."));
        render404If(fileName.contains("/") || fileName.contains(".."));

        Template template = TemplateManager.me().getCurrentTemplate();
        render404If(template == null);

        File pathFile = new File(template.getAbsolutePathFile(), dirName);
        try {
            FileUtils.copyFile(uploadFile.getFile(), new File(pathFile, fileName));
        } catch (Exception e) {
            e.printStackTrace();
            renderFailJson();
            return;
        } finally {
            deleteFileQuietly(uploadFile.getFile());
        }

        if (fileName.toLowerCase().endsWith(".html")) {
            template.addNewHtml(fileName);
            TemplateManager.me().clearCache();
        }

        renderOkJson();
    }
 
Example #6
Source File: _AddonController.java    From jpress with GNU Lesser General Public License v3.0 5 votes vote down vote up
private void renderFail(String msg, UploadFile... uploadFiles) {
    renderJson(Ret.fail()
            .set("success", false)
            .setIfNotBlank("message", msg));

    for (UploadFile ufile : uploadFiles) {
        deleteFileQuietly(ufile.getFile());
    }
}
 
Example #7
Source File: _AddonController.java    From jpress with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * 进行插件安装
 */
public void doUploadAndUpgrade() {
    if (!isMultipartRequest()) {
        renderError(404);
        return;
    }

    UploadFile ufile = getFile();
    if (ufile == null) {
        renderFail(null);
        return;
    }

    String oldAddonId = getPara("id");
    AddonInfo oldAddon = AddonManager.me().getAddonInfo(oldAddonId);
    if (oldAddon == null) {
        renderFail("无法读取旧的插件信息,可能已经被卸载。", ufile);
        return;
    }

    if (!StringUtils.equalsAnyIgnoreCase(FileUtil.getSuffix(ufile.getFileName()), ".zip", ".jar")) {
        renderFail("只支持 .zip 或 .jar 的插件文件", ufile);
        return;
    }

    try {
        Ret ret = AddonManager.me().upgrade(ufile.getFile(), oldAddonId);
        render(ret);
        return;
    } catch (Exception ex) {
        LOG.error(ex.toString(), ex);
        renderFail("插件升级失败,请联系管理员", ufile);
        return;
    } finally {
        deleteFileQuietly(ufile.getFile());
    }
}
 
Example #8
Source File: SysSettingController.java    From my_curd with Apache License 2.0 5 votes vote down vote up
/**
 * 导入excel
 */
@SuppressWarnings("Duplicates")
@Before(Tx.class)
public void importExcel() {
    UploadFile uploadFile = getFile();
    if (uploadFile == null) {
        renderFail("上传文件不可为空");
        return;
    }
    if (!FilenameUtils.getExtension(uploadFile.getFileName()).equals("xls")) {
        FileUtils.deleteFile(uploadFile.getFile());
        renderFail("上传文件后缀必须是xls");
        return;
    }

    List<SysSetting> list;
    try {
        ImportParams params = new ImportParams();
        params.setTitleRows(1);
        params.setHeadRows(1);
        list = ExcelImportUtil.importExcel(uploadFile.getFile(), SysSetting.class, params);
    } catch (Exception e) {
        log.error(e.getMessage(), e);
        FileUtils.deleteFile(uploadFile.getFile());
        renderFail("模板文件格式错误");
        return;
    }

    for (SysSetting sysSetting : list) {
        sysSetting.setId(IdUtils.id())
                .setUpdater(WebUtils.getSessionUsername(this))
                .setUpdateTime(new Date())
                .save();
    }

    FileUtils.deleteFile(uploadFile.getFile());
    refreshSetting();
    renderSuccess(IMPORT_SUCCESS);
}
 
Example #9
Source File: ProcessDeployController.java    From my_curd with Apache License 2.0 5 votes vote down vote up
public void deployAction() {
    UploadFile file = getFile();
    if (file == null) {
        renderFail("部署失败");
        return;
    }
    String extension = FilenameUtils.getExtension(file.getFileName());
    if (!"zip".equalsIgnoreCase(extension)) {
        renderFail("部署包必须是zip压缩文件");
        return;
    }
    String category = get("category");
    String name = get("name");
    if (StringUtils.isEmpty(category) || StringUtils.isEmpty(name)) {
        renderFail("参数缺失");
        return;
    }

    try (InputStream in = new FileInputStream(file.getFile())) {
        ZipInputStream zipInputStream = new ZipInputStream(in);
        Deployment deployment = ActivitiKit.getRepositoryService()
                .createDeployment().addZipInputStream(zipInputStream)
                .category(category)
                .name(name)
                .deploy();

        log.info("{} 部署流程, deploymentId:{}, deploymentName:{}, deploymentCategory:{}",
                WebUtils.getSessionUsername(this), deployment.getId(), deployment.getName(), deployment.getCategory());

    } catch (Exception e) {
        log.error(e.getMessage(), e);
        throw new RuntimeException(e);
    }
    FileUtils.deleteFile(file.getFile());

    renderSuccess("部署成功");
}
 
Example #10
Source File: ExSingleTableController.java    From my_curd with Apache License 2.0 5 votes vote down vote up
/**
 * 导入excel
 */
@Before(Tx.class)
public void importExcel() {
    UploadFile uploadFile = getFile();
    if (uploadFile == null) {
        renderFail("上传文件不可为空");
        return;
    }
    if (!FilenameUtils.getExtension(uploadFile.getFileName()).equals("xls")) {
        FileUtils.deleteFile(uploadFile.getFile());
        renderFail("上传文件后缀必须是xls");
        return;
    }

    List<ExSingleTable> list;
    try {
        ImportParams params = new ImportParams();
        params.setTitleRows(1);
        params.setHeadRows(1);
        list = ExcelImportUtil.importExcel(uploadFile.getFile(), ExSingleTable.class, params);
    } catch (Exception e) {
        log.error(e.getMessage(), e);
        FileUtils.deleteFile(uploadFile.getFile());
        renderFail("模板文件格式错误");
        return;
    }

    for (ExSingleTable exSingleTable : list) {
        System.out.println(exSingleTable);
        System.out.println();
        exSingleTable.setId(IdUtils.id())
                .setCreater(WebUtils.getSessionUsername(this))
                .setCreateTime(new Date())
                .save();
    }

    FileUtils.deleteFile(uploadFile.getFile());
    renderSuccess(IMPORT_SUCCESS);
}
 
Example #11
Source File: FileController.java    From jboot with Apache License 2.0 5 votes vote down vote up
public void index() {
    UploadFile uploadFile = getFile();
    if (uploadFile != null)
        System.out.println("uploadFile " + uploadFile.getOriginalFileName());
    else
        System.out.println("uploadFile null");

    renderText("ok");
}
 
Example #12
Source File: FileController.java    From my_curd with Apache License 2.0 4 votes vote down vote up
/**
 * 单文件上传
 */
public void upload() throws IOException {
    UploadFile uploadFile = getFile("file");

    if (uploadFile == null) {
        renderFail(PARAM_FILE_EMPTY);
        return;
    }

    String originalFileName = uploadFile.getOriginalFileName();
    String extension = FilenameUtils.getExtension(originalFileName);

    // 文件类型非法
    if (!checkFileType(extension)) {
        FileUtils.deleteFile(uploadFile.getFile());
        renderFail(extension + FILE_TYPE_NOT_LIMIT);
        return;
    }

    // 文件保存
    String relativePath = fileRelativeSavePath(extension);
    File saveFile = new File(PathKit.getWebRootPath() + "/" + relativePath);
    if (saveFile.exists()) {
        FileUtils.deleteFile(uploadFile.getFile());
        renderFail(originalFileName + FILE_EXIST);
        return;
    }


    FileUtils.copyFile(uploadFile.getFile(), saveFile);
    FileUtils.deleteFile(uploadFile.getFile());

    UploadResult uploadResult = new UploadResult();
    uploadResult.setName(originalFileName);
    uploadResult.setPath(relativePath);
    long sizeL = saveFile.length();
    uploadResult.setSizeL(sizeL);
    uploadResult.setSize(FileUtils.byteCountToDisplaySize(sizeL));
    StringBuffer url = getRequest().getRequestURL();
    String uri = url.delete(url.length() - getRequest().getRequestURI().length(), url.length()).append(getRequest().getServletContext().getContextPath()).append("/").toString();
    uploadResult.setUri(uri + relativePath);

    Ret ret = Ret.create().setOk().set("data", uploadResult);
    renderJson(ret);
}
 
Example #13
Source File: ControllerExt.java    From jfinal-ext3 with Apache License 2.0 4 votes vote down vote up
/**
 * Get upload file save to date path.
 */
public List<UploadFile> getFilesSaveToDatePath(Integer maxPostSize, String encoding) {
	return super.getFiles(UploadPathKit.getDatePath(), maxPostSize, encoding);
}
 
Example #14
Source File: _AddonController.java    From jpress with GNU Lesser General Public License v3.0 4 votes vote down vote up
/**
 * 进行插件安装
 */
public void doUploadAndInstall() {
    if (!isMultipartRequest()) {
        renderError(404);
        return;
    }

    UploadFile ufile = getFile();
    if (ufile == null) {
        renderJson(Ret.fail().set("success", false));
        return;
    }

    if (!StringUtils.equalsAnyIgnoreCase(FileUtil.getSuffix(ufile.getFileName()), ".zip", ".jar")) {
        renderFail("只支持 .zip 或 .jar 的插件文件",ufile);
        return;
    }

    AddonInfo addon = AddonUtil.readSimpleAddonInfo(ufile.getFile());
    if (addon == null || StrUtil.isBlank(addon.getId())) {
        renderFail("无法读取插件配置信息。",ufile);
        return;
    }

    File newAddonFile = addon.buildJarFile();

    //当插件文件存在的时候,有两种可能
    // 1、该插件确实存在,此时不能再次安装
    // 2、该插件可能没有被卸载干净,此时需要尝试清除之前已经被卸载的插件
    if (newAddonFile.exists()) {

        //说明该插件已经被安装了
        if (AddonManager.me().getAddonInfo(addon.getId()) != null) {
            renderFail("该插件已经存在。",ufile);
            return;
        }
        //该插件之前已经被卸载了
        else {

            //尝试再次去清除jar包,若还是无法删除,则无法安装
            if (!AddonUtil.forceDelete(newAddonFile)) {
                renderFail("该插件已经存在。",ufile);
                return;
            }
        }
    }

    if (!newAddonFile.getParentFile().exists()) {
        newAddonFile.getParentFile().mkdirs();
    }

    try {
        FileUtils.moveFile(ufile.getFile(), newAddonFile);
        if (!AddonManager.me().install(newAddonFile)) {
            renderFail("该插件安装失败,请联系管理员。",ufile);
            return;
        }
        if (!AddonManager.me().start(addon.getId())) {
            renderFail("该插件安装失败,请联系管理员。",ufile);
            return;
        }
    } catch (Exception e) {
        LOG.error("addon install error : ", e);
        renderFail("该插件安装失败,请联系管理员。",ufile);
        deleteFileQuietly(newAddonFile);
        return;
    }

    renderJson(Ret.ok().set("success", true));
}
 
Example #15
Source File: ControllerExt.java    From jfinal-ext3 with Apache License 2.0 4 votes vote down vote up
public UploadFile getFileSaveToDatePath(String parameterName) {
	return super.getFile(parameterName, UploadPathKit.getDatePath());
}
 
Example #16
Source File: _TemplateController.java    From jpress with GNU Lesser General Public License v3.0 4 votes vote down vote up
/**
 * 进行模板安装
 */
public void doInstall() {

    render404If(!isMultipartRequest());

    UploadFile ufile = getFile();
    if (ufile == null) {
        renderJson(Ret.fail().set("success", false));
        return;
    }

    if (!".zip".equalsIgnoreCase(FileUtil.getSuffix(ufile.getFileName()))) {
        renderJson(Ret.fail()
                .set("success", false)
                .set("message", "只支持 .zip 的压缩模板文件"));
        deleteFileQuietly(ufile.getFile());
        return;
    }


    String webRoot = PathKit.getWebRootPath();
    StringBuilder newFileName = new StringBuilder(webRoot);
    newFileName.append(File.separator);
    newFileName.append("templates");
    newFileName.append(File.separator);
    newFileName.append("dockers"); // 优先安装在docker的映射目录下

    File templateRootPath = new File(newFileName.toString());
    if (!templateRootPath.exists() || !templateRootPath.isDirectory()) {
        templateRootPath = templateRootPath.getParentFile();
    }

    File templateZipFile = new File(templateRootPath, ufile.getOriginalFileName());
    String templatePath = templateZipFile.getAbsolutePath()
            .substring(0, templateZipFile.getAbsolutePath().length() - 4);

    if (new File(templatePath).exists()) {
        renderJson(Ret.fail()
                .set("success", false)
                .set("message", "该模板可能已经存在,无法进行安装。"));
        deleteFileQuietly(ufile.getFile());
        return;
    }


    try {
        FileUtils.moveFile(ufile.getFile(), templateZipFile);
        FileUtil.unzip(templateZipFile.getAbsolutePath(), templatePath);
    } catch (Exception e) {
        renderJson(Ret.fail()
                .set("success", false)
                .set("message", "模板文件解压缩失败"));
        return;
    } finally {
        //安装成功后,删除zip包
        deleteFileQuietly(templateZipFile);
        deleteFileQuietly(ufile.getFile());
    }

    renderJson(Ret.ok().set("success", true));
}
 
Example #17
Source File: ControllerExt.java    From jfinal-ext3 with Apache License 2.0 4 votes vote down vote up
public List<UploadFile> getFilesSaveToDatePath() {
	return super.getFiles(UploadPathKit.getDatePath());
}
 
Example #18
Source File: CKEditorController.java    From jpress with GNU Lesser General Public License v3.0 4 votes vote down vote up
public void upload() {

        if (!isMultipartRequest()) {
            renderError(404);
            return;
        }

        UploadFile uploadFile = getFile();
        if (uploadFile == null) {
            renderJson(Ret.create("error", Ret.create("message", "请选择要上传的文件")));
            return;
        }


        File file = uploadFile.getFile();
        if (!getLoginedUser().isStatusOk()){
            file.delete();
            renderJson(Ret.create("error", Ret.create("message", "当前用户未激活,不允许上传任何文件。")));
            return;
        }


        if (AttachmentUtils.isUnSafe(file)){
            file.delete();
            renderJson(Ret.create("error", Ret.create("message", "不支持此类文件上传")));
            return;
        }


        String mineType = uploadFile.getContentType();
        String fileType = mineType.split("/")[0];

        Integer maxImgSize = JPressOptions.getAsInt("attachment_img_maxsize", 2);
        Integer maxOtherSize = JPressOptions.getAsInt("attachment_other_maxsize", 10);
        Integer maxSize = "image".equals(fileType) ? maxImgSize : maxOtherSize;
        int fileSize = Math.round(file.length() / 1024 * 100) / 100;

        if (maxSize != null && maxSize > 0 && fileSize > maxSize * 1024) {
            file.delete();
            renderJson(Ret.create("error", Ret.create("message", "上传文件大小不能超过 " + maxSize + " MB")));
            return;
        }


        String path = AttachmentUtils.moveFile(uploadFile);
        AliyunOssUtils.upload(path, AttachmentUtils.file(path));

        Attachment attachment = new Attachment();
        attachment.setUserId(getLoginedUser().getId());
        attachment.setTitle(uploadFile.getOriginalFileName());
        attachment.setPath(path.replace("\\", "/"));
        attachment.setSuffix(FileUtil.getSuffix(uploadFile.getFileName()));
        attachment.setMimeType(mineType);

        if (attachmentService.save(attachment) != null) {

            /**
             * {"fileName":"1.jpg","uploaded":1,"url":"\/userfiles\/images\/1.jpg"}
             */
            Map map = new HashMap();
            map.put("fileName", attachment.getTitle());
            map.put("uploaded", 1);
            map.put("url", JFinal.me().getContextPath() + attachment.getPath());
            renderJson(map);
        } else {
            renderJson(Ret.create("error", Ret.create("message", "系统错误")));
        }
    }
 
Example #19
Source File: AttachmentController.java    From jpress with GNU Lesser General Public License v3.0 4 votes vote down vote up
public void upload() {
    if (!isMultipartRequest()) {
        renderError(404);
        return;
    }

    UploadFile uploadFile = getFile();
    if (uploadFile == null) {
        renderJson(Ret.fail().set("message", "请选择要上传的文件"));
        return;
    }


    File file = uploadFile.getFile();
    if (!getLoginedUser().isStatusOk()) {
        file.delete();
        renderJson(Ret.create("error", Ret.create("message", "当前用户未激活,不允许上传任何文件。")));
        return;
    }

    if (AttachmentUtils.isUnSafe(file)) {
        file.delete();
        renderJson(Ret.fail().set("message", "不支持此类文件上传"));
        return;
    }

    String mineType = uploadFile.getContentType();
    String fileType = mineType.split("/")[0];

    Integer maxImgSize = JPressOptions.getAsInt("attachment_img_maxsize", 2);
    Integer maxOtherSize = JPressOptions.getAsInt("attachment_other_maxsize", 10);

    Integer maxSize = "image".equals(fileType) ? maxImgSize : maxOtherSize;

    int fileSize = Math.round(file.length() / 1024 * 100) / 100;
    if (maxSize != null && maxSize > 0 && fileSize > maxSize * 1024) {
        file.delete();
        renderJson(Ret.fail().set("message", "上传文件大小不能超过 " + maxSize + " MB"));
        return;
    }

    String path = AttachmentUtils.moveFile(uploadFile);
    AliyunOssUtils.upload(path, AttachmentUtils.file(path));

    Attachment attachment = new Attachment();
    attachment.setUserId(getLoginedUser().getId());
    attachment.setTitle(uploadFile.getOriginalFileName());
    attachment.setPath(path.replace("\\", "/"));
    attachment.setSuffix(FileUtil.getSuffix(uploadFile.getFileName()));
    attachment.setMimeType(uploadFile.getContentType());

    service.save(attachment);

    renderJson(Ret.ok().set("success", true).set("src", attachment.getPath()));
}
 
Example #20
Source File: _MarkdownImport.java    From jpress with GNU Lesser General Public License v3.0 4 votes vote down vote up
public void doMarkdownImport() {

        UploadFile ufile = getFile();
        if (ufile == null) {
            renderJson(Ret.fail("message", "您还未选择Markdown文件"));
            return;
        }

        if (!".md".equals(FileUtil.getSuffix(ufile.getFileName()))) {
            renderJson(Ret.fail("message", "请选择Markdown格式的文件"));
            return;
        }

        String newPath = AttachmentUtils.moveFile(ufile);
        File mdFile = AttachmentUtils.file(newPath);

        MarkdownParser markdownParser = new MarkdownParser();
        markdownParser.parse(mdFile);

        Article article = null;
        String[] categoryNames = null;

        try {
            article = markdownParser.getArticle();
            categoryNames = markdownParser.getCategories();
        } catch (ParseException e) {
            LogKit.error(e.toString(), e);
            renderJson(Ret.fail("message", "导入失败,可能markdown文件格式错误"));
        } finally {
            mdFile.delete();
        }

        if (null != article) {
            article.setUserId(getLoginedUser().getId());
            articleService.save(article);
        }

        if (null != article && null != categoryNames && categoryNames.length > 0) {
            List<ArticleCategory> categoryList = articleCategoryService.doNewOrFindByCategoryString(categoryNames);
            Long[] allIds = new Long[categoryList.size()];
            for (int i = 0; i < allIds.length; i++) {
                allIds[i] = categoryList.get(i).getId();
            }
            articleService.doUpdateCategorys(article.getId(), allIds);
        }

        renderOkJson();
    }
 
Example #21
Source File: ControllerExt.java    From jfinal-ext3 with Apache License 2.0 4 votes vote down vote up
public UploadFile getFileSaveToDatePath(String parameterName, Integer maxPostSize) {
	return super.getFile(parameterName, UploadPathKit.getDatePath(), maxPostSize);
}
 
Example #22
Source File: ControllerExt.java    From jfinal-ext3 with Apache License 2.0 4 votes vote down vote up
public List<UploadFile> getFilesSaveToDatePath(Integer maxPostSize) {
	return super.getFiles(UploadPathKit.getDatePath(), maxPostSize);
}
 
Example #23
Source File: ControllerExt.java    From jfinal-ext3 with Apache License 2.0 4 votes vote down vote up
public UploadFile getFileSaveToDatePath(String parameterName, Integer maxPostSize, String encoding) {
	return super.getFile(parameterName, UploadPathKit.getDatePath(), maxPostSize, encoding);
}