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

Node-red send image to matrix room #101

Open
unknown1818 opened this issue Oct 22, 2023 · 1 comment
Open

Node-red send image to matrix room #101

unknown1818 opened this issue Oct 22, 2023 · 1 comment

Comments

@unknown1818
Copy link

unknown1818 commented Oct 22, 2023

Hi,

I fighting with this many hours, whats the proper way to send image to matrix room via function node?

inject node: msg.image_url = https://fastly.picsum.photos/id/793/536/354.jpg?hmac=XIFVAzAu0yVaOvzskKwSbjpxtJ4eBif_HtCf92kxsMs

---->

msg.payload = { 
    "url": msg.image_url, 
    "info": { 
        "mimetype": "image/jpg"
    } 
}
return msg;

---->

Matrix send image node

im always getting blank message

msg.payload File | string | Buffer | ReadStream | Blob
the contents of the image to upload.

what i should have inside msg.payload? image url? can you provide some examples

@skylord123
Copy link
Contributor

skylord123 commented Oct 22, 2023

Here is an example of how to use the send image node:
https://github.com/Skylar-Tech/node-red-contrib-matrix-chat/blob/master/examples/README.md#respond-to-image-with-an-uploaded-image

If the image is a remote URL you need to fetch it (with something like an HTTP node) then pass it to the send image node. The mime type MUST be set correctly.

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