We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here.

Forum Discussion

deeptir94's avatar
deeptir94
Explorer | Level 4
5 months ago

.xlsx files are supported but something went wrong

Hi, 

I am using the API to upload files to Dropbox. The API response shows successful upload and I can see the file at the correct location. But when previewing it shows : '.xlsx files are supported but something went wrong'. The file seems to be corrupted when I try to download and open. The source file on my desktop NOT corrupted.

 

Thanks in advance.


  • deeptir94 wrote:

    ... The API response shows successful upload and I can see the file at the correct location. ... The file seems to be corrupted when I try to download and open. The source file on my desktop NOT corrupted.

    ...


    Hi deeptir94,

    Your description means you have called API upload request almost correct (i.e. all params are set correct), except the request body. Keep in mind that the body MUST contain binary equal to the file being upload. Dropbox save the body as uploaded file content exactly as is. If you have encoded the content by mistake (for instance) then the file in your Dropbox will be encoded in the same way (i.e. corrupted). Don't get confused by some other services expectation for content encoding - Dropbox expects raw (unencoded) content! If you're still in confusion, post what you're executing that fails, so be possible the issue reproduction as well as the exact result received - there might be some error indication despite of "successful" result. Also post the expected file size in bytes (as appear in your file explorer).

    Hope this gives direction.

    • deeptivr94's avatar
      deeptivr94
      Explorer | Level 4

      Thanks for your reply.

      I am using multipart/form-data to upload an excel file using REST web Services of an Automation Anywhere. File is around 150-200 KB. 

      • Здравко's avatar
        Здравко
        Legendary | Level 20

        deeptivr94 wrote:

        ...

        I am using multipart/form-data to upload an excel file ... 


        deeptivr94, If you use "multipart/form-data", that's exactly what you save in your file. 🤷🙂 It's NOT your file but it's multipart form data encoded representation of your file. That's it - one to one.

        You can check as open your file in a text editor. At the beginning, the headers of your encoding will be there.