Skip to Content
avatar image
Former Member

Excel file Upload/download attachment issue

Hi Experts,

I am downloading an excel file from SAP gateway. I am using the below code for the same. I am able to download the excel file successfully but when I open the same I get some junk value as content i.e. the content is not at readable format.

I get a alert message as below while opening the file.

"Excel cannot open the file Demo.xls because the file format or file extension is not valid. Verify that file has not been corrupted and that the file extension matches the format of the file"

Upload Code:

upload excel

Download Code:

download excel

downloadexcel.png (17.4 kB)
uploadexcel.png (60.8 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Mar 09, 2017 at 03:50 PM

    if you are using gw excel export function , the suffix should be xlsx

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Jun Wu,

      Thanks for your inputs.

      The suffix used is xlsx only.

      The issue is :

      if we are upload excel from gateway, it is uploading successfully. On downloading the excel from UI, it gets downloaded with right content of data.

      But if we are upload excel from UI, it is uploading successfully. On downloading the excel from UI, it gets downloaded with junk content of data.

      And, alert message as below while opening the file.

      "Excel cannot open the file Demo.xls because the file format or file extension is not valid. Verify that file has not been corrupted and that the file extension matches the format of the file".

  • Mar 10, 2017 at 12:43 PM

    what's the backend code to handle upload?

    Add comment
    10|10000 characters needed characters exceeded