How to send a local file through a Phoenix Channel?

Basically that, I have a personal web application where I want to add that feature, right now the focus of it is processing some files. The user provides a link and then they’re redirected to a Y url which is connected to a topic, after the files are processed (They’re stored on a folder in the root of the project) I want to send that file specifically to that user on the topic so they’ll start downloading it. What are my options to accomplish this?

You can send the client a link to download the file through the channels, and then download it through JS or in some other way.

Or you can stream the contents of the file through channels. But the first approach is probably simpler and easier.

1 Like

That’s what I was thinking, there’s no way to directly send the file without them clicking a link? I’m the only one using this but I understand the security or privacy reasons behind to not allow something like this.

You don’t have to click anything. You can download the file with some javascript. It just needs to know where to download from, and that’s what the link will be for. It can be signed or require a bearer token which you can also send through channels … Don’t see any security or privacy problems with this.