cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to know what we learned at IBC? Check out our learnings on media, remote working and more right here.

Discuss Dropbox Developer & API

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

.xlsx files are supported but something went wrong

.xlsx files are supported but something went wrong

deeptir94
Explorer | Level 4

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.

3 Replies 3

Здравко
Legendary | Level 20

@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
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. 

Здравко
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.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Здравко Legendary | Level 20
  • User avatar
    deeptivr94 Explorer | Level 4
What do Dropbox user levels mean?