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

API call 'save_artifact_file' produces an error, a crash or an unusable .bin file when provided with an image #265

Open
ajenyon opened this issue Dec 29, 2023 · 0 comments

Comments

@ajenyon
Copy link

ajenyon commented Dec 29, 2023

Steps to Reproduce the Problem

  1. Use the API to obtain an authorisation token (this works just fine):

curl -X POST https://<spacedeck_domain>/sessions -H "Content-Type: application/json" -d '{"email": "<your_email>","password": "<your_password>"}'

  1. Create an empty artifact, and obtain the artifact ID (this also works, and returns an artifact id, amongst other info):

curl -X POST http://127.0.0.1:9666/api/spaces/<space_id>/artifacts -H "Content-Type: application/json" -H "X-Spacedeck-Auth: <api_token>" -d "{"space_id": "<space_id>","x": 1410,"y": 1257,"w": 320,"h": 170,"r": 0}"

  1. Attempt to upload a jpeg as a payload into this artifact:

curl -X POST http://127.0.0.1:9666/api/spaces/<space_id>/artifacts/<artifact_id>/payload?filename="testimg.jpg" -H "X-Spacedeck-Auth: <api_token>" -F "file=@C:*******\testimg.jpg;type=image/jpeg"

Expected Behavior

Local image file is uploaded to spacedeck/storage/my_spacedeck_bucket/<artifact_id> as a jpeg, along with generated thumbnails
The image is assigned to the artifact, and is visible when the page is reloaded

Actual Behavior

With the curl command as written:
{"code":1,"signal":null}

With "payload?filename=testimg" (no type):
Docker container crashes, and needs to be restarted

With just "payload":
A .bin file is created in the expected location, rather than an image. It has the same file size as the original jpeg, but doesn't appear in the space as an image, and cannot be opened as one (even if the filetype is changed back to .jpg.

Specifications

Latest version (Dec 2023) running from default docker container under Windows 10

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

1 participant