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

POST api/image-gallery reurn 500 and no content #5338

Open
GamerClassN7 opened this issue Nov 27, 2024 · 5 comments
Open

POST api/image-gallery reurn 500 and no content #5338

GamerClassN7 opened this issue Nov 27, 2024 · 5 comments
Labels

Comments

@GamerClassN7
Copy link
Contributor

GamerClassN7 commented Nov 27, 2024

Describe the Bug

when i trying to upload, ima with this request

$headers=@{}
$headers.Add("Content-Type", "multipart/form-data; boundary=---011000010111000001101001")
$headers.Add("Authorization", "Token ")
$response = Invoke-RestMethod -Uri '' -Method POST -Headers $headers -ContentType 'multipart/form-data; boundary=---011000010111000001101001' -Body '-----011000010111000001101001
Content-Disposition: form-data; name="type"

gallery
-----011000010111000001101001
Content-Disposition: form-data; name="uploaded_to"

196817
-----011000010111000001101001
Content-Disposition: form-data; name="image"; filename="2821d7ed-da77-47b2-940a-7e3905f4e94f.jpeg"
Content-Type: image/jpeg


-----011000010111000001101001--

Steps to Reproduce

Op api client of your choice and try to upload file

Expected Behaviour

upload file

Screenshots or Additional Context

image

Browser Details

No response

Exact BookStack Version

BookStack v24.10.2 https://docs.linuxserver.io/images/docker-bookstack/

@GamerClassN7
Copy link
Contributor Author

What i tried ho threw all available logs, nothing, enable APP_DEBUG, also no result

@ssddanbrown
Copy link
Member

Hi @GamerClassN7,

If you're seeing a 500 that really should be logged at some level. Check error logs at the proxy(ies) level(s) first then work down, as this might not be reaching the app container if the format is invalid, which could be easy to get wrong if manually creating multipart requests.

Without testing it, the code looks okay apart from not knowing what's been redacted/trimmed from this example. Is the file content actually being added to the multi-part body (I see no direct inclusion of the actual jpeg image data in any of this).

@GamerClassN7
Copy link
Contributor Author

GamerClassN7 commented Dec 4, 2024

Hi @GamerClassN7,

If you're seeing a 500 that really should be logged at some level. Check error logs at the proxy(ies) level(s) first then work down, as this might not be reaching the app container if the format is invalid, which could be easy to get wrong if manually creating multipart requests.

Without testing it, the code looks okay apart from not knowing what's been redacted/trimmed from this example. Is the file content actually being added to the multi-part body (I see no direct inclusion of the actual jpeg image data in any of this).

Hi i checked every possible log nothing there, but interesting few other Files get threw ? just first 100 or so, on other hand i am able to paste them in WYSIWYG editor. Would be possible to connect over discord (Images contains mac addresses and SN o HW) or something no so open/public so maybe i can share few images with you to check if you are able to figure something what can be wrong.

@ssddanbrown
Copy link
Member

  • Do those images work if uploading via the UI?
  • Are you sure they are jpeg images?

@GamerClassN7
Copy link
Contributor Author

  • Do those images work if uploading via the UI?
  • Are you sure they are jpeg images?
  • yes
  • yes

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

No branches or pull requests

2 participants