title: upload document with metadata in liferay
body: <p>i am trying to upload document with metadata . simple file uploader portlet is working perfectly but when i try to attach metadata it sends request failed error</p>
  
  <p>this is my code</p>
  
  <pre><code>public DLFileEntry upload(ActionRequest request, ActionResponse response)  throws Exception 
  {
      // TODO Auto-generated method stub
      ServiceContext sc = new ServiceContext();
      Date date1 = (Date) request.getAttribute("efrom");
      Date date2 = (Date) request.getAttribute("efrom");
      String getTitle = request.getParameter("Title");
      String getDesc = request.getParameter("Description");
      String CKEditor = request.getParameter("CKE");
  
      ThemeDisplay themeDisplay = (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY);
      long defaultRepoId = DLFolderConstants.getDataRepositoryId(themeDisplay.getScopeGroupId(), DLFolderConstants.DEFAULT_PARENT_FOLDER_ID);
  
      String rtfoutput = FileIO.readFromFile(tPath);
  
      File tempFile = new File(tPath);
      InputStream is = new FileInputStream(tempFile);
  
      Folder folderName = DLAppLocalServiceUtil.getFolder(defaultRepoId, 0, "Folder Name");
      long folderId = folderName.getFolderId();
      long repositoryId = folderName.getRepositoryId();
  
      byte[] bytes = rtfoutput.getBytes();
  
      Map&lt;String, Fields &gt; fieldsMap = new HashMap&lt;String, Fields &gt;();
      Fields targetFields = new Fields();
      targetFields.put(new Field("Effective-To", date1));
      targetFields.put(new Field("Effective-From", date2));
  
      fieldsMap.put("", targetFields);
  
      DLFileEntry dlFileEntry = DLFileEntryLocalServiceUtil.addFileEntry(defaultRepoId, 0L, repositoryId, folderId, getTitle+".rtf", "RichTextFormat", getTitle, StringPool.BLANK, StringPool.BLANK, 0L,
              fieldsMap, tempFile, is, tempFile.getTotalSpace(), sc);
  
      return dlFileEntry;
  }
  </code></pre>
  
  <p>i am not getting why this is saying request failed</p>
  
  <p>date1 and date2 are the meta deta which i am trying to attact with document</p>