cancel
Showing results for 
Search instead for 
Did you mean: 

Single File Upload Issue faced while opening the file from Backend

former_member527286
Discoverer
0 Kudos

Hi All,

The backend team is facing issue while re opening the file that is stored in the table.

1. I have used sap.ui.unified for single File Upload from front end.

2. The code snippet from view is

FileUploader id="UploadMedia"

  name="UploadMedia"

  uploadUrl="/Url Path/ET_AttachSet/"

  sendXHR= "true"

  change="handleFileUploadChange"

  fileType='doc,docx,docm,pdf,jpg'

  uploadComplete="handleUploadComplete"

  width="100%"/>

3. Controller Code snippet for file upload is ::

I have refreshed the token and uploaded the file using FileUploader.upload();

4. The file is getting uploaded in the table and I am getting the

  1. Status Code:201 Created
  2. The request Payload Information is ::
  3. ------WebKitFormBoundaryuwt3U1E200UBrodY Content-Disposition: form-data; name="UploadMedia"; filename="SSK.doc" Content-Type: application/msword ------WebKitFormBoundaryuwt3U1E200UBrodY Content-Disposition: form-data; name="_charset_" UTF-8 ------WebKitFormBoundaryuwt3U1E200UBrodY Content-Disposition: form-data; name="UploadMedia-data" ------WebKitFormBoundaryuwt3U1E200UBrodY--
  4. 5. The back end team is not able to reopen the file from their end.

  5. Kindly help us in this regarding.

Accepted Solutions (0)

Answers (1)

Answers (1)

gill367
Active Contributor
0 Kudos

Hi

Have you also converted it to base64 before sending it to backend.

As mentioned in the below thread.

https://scn.sap.com/thread/3670662

Regards,

Sarbjeet Singh

former_member527286
Discoverer
0 Kudos

I am using sap.ui.unified.


var oFileUploader = this.getView().byId("fileUploader");

oFileUploader.upload();


By using the above method here I am sending the raw data by calling the upload method.

The backend team is expecting the data in XString and I am send in the raw data. So he is not able to reopen the file.