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

Pleroma: uploadMedia fails with 400 #1893

Open
aneillans opened this issue Sep 9, 2023 · 2 comments
Open

Pleroma: uploadMedia fails with 400 #1893

aneillans opened this issue Sep 9, 2023 · 2 comments

Comments

@aneillans
Copy link

const M = generator('pleroma', https://${data.website}, data.tokenData.access_token);
const upload = await M.uploadMedia(file.value, { description: altText });

Upload aborts with a 400 against a newly deployed Pleroma instance; am I missing something?
All variables are set with contents. Is there specific encodings needed?

Megalodon version: v7.0.0
Pleroma Version: 2.7.2

@aneillans aneillans changed the title Pleroma Pleroma: uploadMedia fails with 400 Sep 9, 2023
@aneillans
Copy link
Author

Looking through the server log I can find this, but I though this issue was fixed previously?

19:21:11.539 request_id=F4NRSzugomogDCgAAD8i [error] Internal server error: %Plug.Parsers.BadEncodingError{message: "invalid UTF-8 on multipart body, got byte 255", plug_status: 400}

@aneillans
Copy link
Author

In my original post, file.value is a Buffer.

If I save the contents to a temp file, then open with fs.createReadStream and pass that in, the upload works?

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