Uploaded image is empty or corrupted | Community
Skip to main content

Uploaded image is empty or corrupted

  • May 9, 2022
  • 3 replies
  • 0 views

Dilan

Hi Team,

I'm trying to upload a image (downloaded from google), through Spring boot code. The image seems uploaded but I cannot see the thumbnail, even when I download the image it always 1 KB, so empty or broken. 

Details : 

API - /api/v2/uploads?filename=<my file name>

header - headers.set("Content-Type", "application/binary");

Can someone please help on this ?

Thanks,

Dilan.

 

3 replies

Jack23
  • May 9, 2022

Hi Dilan,

I think your problem might be to do with the MIME type you are setting, you’re setting it to application/binary but the file is an image.

Could you try changing it to image/jpeg and let me know if that works?


Dilan
  • Author
  • May 9, 2022

Hi, Thanks for quick response.

I changed the content type to "image/jpeg", but still the same result. I can only see the empty image.

Thanks.


Greg29
  • May 12, 2022

Hi Dilan! Can you take a look at this article and see if it gets you moving in the right direction?