Beispiel #1
0
  // upload video
  public String upload_video() throws Exception {
    session = ActionContext.getContext().getSession();
    Student student = (Student) session.get("user");

    photoService.saveVideo(video_url, student.getStudentid());
    return SUCCESS;
  }
Beispiel #2
0
 public String upload() throws Exception {
   session = ActionContext.getContext().getSession();
   if (file == null) {
     return "fail";
   }
   Student student = (Student) session.get("user");
   String url = ServletActionContext.getServletContext().getRealPath("/photo");
   String filename = getTimeStamp() + "." + getExt();
   System.out.println(url + fileFileName + "    " + text);
   File image = new File(url, filename);
   FileUtils.copyFile(file, image);
   photoService.savePhoto(filename, student.getStudentid(), text);
   return SUCCESS;
 }