Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

downloadObject() error Server returned HTTP response code: 400 #4

Closed
adihanifsdr opened this issue Mar 21, 2020 · 8 comments
Closed

Comments

@adihanifsdr
Copy link
Contributor

Hello guys,

I have many files and i successfully download those but i have problem with only several files that can't be downloaded because of this error:
java.lang.Exception: java.io.IOException: Server returned HTTP response code: 400 for URL: https://storage.bunnycdn.com/xxxxxxxx/xxxxxxx/x/x/xxxx.zip

This problems only happens with this several files. what i already tried:

  1. Delete then re-upload again
  2. Re-upload this file with different name, and then try download it again from my Java app
  3. Checking for file corrupt, no this file isn't corrupt because i can opened it

All of those attempt doesn't seem to make it work.

The URL seems fine, i even try it on the browser and i can access it. Any explanation regarding this error?

@adihanifsdr
Copy link
Contributor Author

Based on this articles https://support.bunnycdn.com/hc/en-us/articles/360024887131-Typical-HTTP-Response-Codes, i know that 400 means Bad Request / The server could not understand the request that it was sent. But why this is happen only to my several files? Re-uploading with different names also doesn't work

@doghouch
Copy link
Contributor

doghouch commented Mar 21, 2020

Edit #2: @adihanifsdr

I've repaired the first issue; I think I know why you're experiencing issues with downloadObject() -- I'll try to have it fixed by tomorrow.

@doghouch doghouch pinned this issue Mar 21, 2020
@doghouch
Copy link
Contributor

Just to confirm -- @adihanifsdr:

What was the name of the file?

@adihanifsdr
Copy link
Contributor Author

adihanifsdr commented Mar 22, 2020

@doghouch

  1. Belakang Hangar Heli - Copy.BGL
  2. Belakang Hangar Heli.BGL
  3. Hotel Hakaya - Copy.BGL
  4. Hotel Hakaya.BGL

Do you also need the file to test?

@doghouch
Copy link
Contributor

doghouch commented Mar 22, 2020

@adihanifsdr I don’t need a file right now — I’ll try to replicate the issue with your file name(s).

Thank you for your patience :-)

@adihanifsdr
Copy link
Contributor Author

adihanifsdr commented Mar 23, 2020

@doghouch I found something interesting, the downloadObject() seems can't download files that contains title 'space Ha'. I tried on upload file with name A Ha.txt and B Ha.txt and try to download it on my Java app and it fails.

@adihanifsdr
Copy link
Contributor Author

I found the solution, check out my pull request #5

@doghouch
Copy link
Contributor

@adihanifsdr Honestly, I would’ve never thought that spaces needed to replaced by their HEX equiv. (I thought that Java’s HttpsUrlConnection would handle that)

Thanks again — I’ve looked over the changes and it looks good. PR accepted and I’ll close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants