jfianl获取表单数据,需要先getFile()获取文件,再使用getPara()

 

public class ImageUploadController extends Controller{

    public void upload() {
        ID oid = Application.getCaller().getOrganizationId();
        UploadFile uf = getFile();
        String urlForSave = getPara("urlForSave");
       String date = DateFormatUtils.getDateFormat("YYYYMMdd").format(CalendarUtils.now());
        File dir = new File("d:\\" + oid.toString() + "\\" +  date);
        if (!dir.exists() || !dir.isDirectory()) {
            dir.mkdirs();
        }
        uf.getFile().renameTo(new File(dir, urlForSave));
        renderNull();
    }
}

  

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-05
  • 2021-08-28
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-05-18
  • 2022-12-23
  • 2021-11-07
  • 2022-12-23
  • 2021-05-15
  • 2022-12-23
相关资源
相似解决方案