Error from Dropbox API

I run into an error when i try to upload a file to dropbox.
It still create the file in Dropbox but when i go to dropbox it said the file is damaged.
So their is defiently something wrong when i upload it.

Can someone of you help me?