Search in sources :

Example 1 with UploadUtils

use of net.jforum.view.forum.common.UploadUtils in project jforum2 by rafaelsteil.

the class SmiliesAction method processUpload.

private String processUpload() {
    String imgName = "";
    if (this.request.getObjectParameter("smilie_img") != null) {
        FileItem item = (FileItem) this.request.getObjectParameter("smilie_img");
        UploadUtils uploadUtils = new UploadUtils(item);
        imgName = MD5.crypt(item.getName());
        uploadUtils.saveUploadedFile(SystemGlobals.getApplicationPath() + "/" + SystemGlobals.getValue(ConfigKeys.SMILIE_IMAGE_DIR) + "/" + imgName + "." + uploadUtils.getExtension());
        imgName += "." + uploadUtils.getExtension();
    }
    return imgName;
}
Also used : FileItem(net.jforum.util.legacy.commons.fileupload.FileItem) UploadUtils(net.jforum.view.forum.common.UploadUtils)

Aggregations

FileItem (net.jforum.util.legacy.commons.fileupload.FileItem)1 UploadUtils (net.jforum.view.forum.common.UploadUtils)1