title: File Uploading Issue in SAP Hana Cloud Platform Document Service
body: <p>I have created a Java Servlet to access the HCP repository. I have used sap.ui.unified.FileUploader to upload a file to the above repository.It gives me following error:
  409 Conflict, {"exception":"constraint","message":"Mandatory property missing: cmis:name"}.</p>
  
  <p>I have used following code to submit data as a form using fileuploader:</p>
  
  <pre><code>&lt;upload:FileUploader id="fileUploader" uplaodStart="handleUploadStart" uploadProgress="handleUploadProgress" uploadComplete="handleUploadComplete"&gt;
                      &lt;upload:parameters&gt;
                          &lt;upload:FileUploaderParameter name="cmisaction" value="createDocument"&gt;&lt;/upload:FileUploaderParameter&gt;
                          &lt;upload:FileUploaderParameter name="propertyId[0]" value="cmis:objectTypeId"&gt;&lt;/upload:FileUploaderParameter&gt;
                          &lt;upload:FileUploaderParameter name="propertyValue[0]" value="cmis:document"&gt;&lt;/upload:FileUploaderParameter&gt;
                          &lt;upload:FileUploaderParameter name="propertyId[1]" value="cmis:name"&gt;&lt;/upload:FileUploaderParameter&gt;
                          &lt;upload:FileUploaderParameter name="propertyValue[1]" id="cmisname"&gt;&lt;/upload:FileUploaderParameter&gt;
                      &lt;/upload:parameters&gt;
                  &lt;/upload:FileUploader&gt;
                  &lt;Button text="Upload File" press="handleUploadPress"/&gt;
  </code></pre>
  
  <p>and the code in controller is as follows:</p>
  
  <pre><code>handleUploadPress: function(oEvent) {
          debugger;
          var oFileUploader = this.getView().byId("fileUploader");
          var repoid="94hjinnfsai8opwroiwlnnsa";
          var file = jQuery.sap.domById(oFileUploader.getId()+"-fu").files[0];
          this.getView().byId("cmisname").setValue(file.name);
          oFileUploader.setUploadUrl("/destinations/destinationName/json/"+repoid+"/root");
          oFileUploader.setFileType("multipart/form-data");
          oFileUploader.upload();
      }
  </code></pre>
  
  <p>I am using the cmis:name parameter in the parameters aggregation of fileuploader but sometimes it works and sometimes it gives the above error. However, html5 form provided in the documentation works perfectly. So, I have used fileuploader to act as a form. The html5 code is as below:</p>
  
  <pre><code>&lt;form action="/destinations/destinationName/json/c4hjinnfsai8opwroiwlnnsa/root"
      enctype="multipart/form-data" method="post"&gt;
      &lt;p&gt;
          Please specify a file:&lt;br&gt; &lt;input type="file" id="filename"
              onchange="setFilename()" name="datafile" size="40"&gt;
      &lt;/p&gt;
      &lt;div&gt;
          &lt;input type="submit" value="Upload"&gt; 
              &lt;input name="cmisaction" type="hidden" value="createDocument"/&gt; 
              &lt;input name="propertyId[0]" type="hidden" value="cmis:objectTypeId"/&gt; 
              &lt;input name="propertyValue[0]" type="hidden" value="cmis:document"/&gt; 
              &lt;input name="propertyId[1]" type="hidden" value="cmis:name"/&gt; 
              &lt;input name="propertyValue[1]" type="hidden" id="cmisname"/&gt;
      &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Please help.</p>