In a my project in Ruby On Rails (but this is not important),
when I load a html page, I need to decrypt an image (jpg) and show it in the web page:
after the page request, the image is decrypted an the file is write on the server disk, so the browser can show the image.
I don’t want to write the image on the server, but I want to encrypt the image on the fly !
I think that ajax (jquery) could be helpfull, but I don’t know how use it to the image on the fly (without write the image on the disk).
Do you have any Idea ?
thank you,
Alessandro
You can use
send_datainstead of rendering a page. Take a look here. With this you can generate your file and send it without saveing to disk. However normal page won’t be rendered. But you can use it like this:1.Create normal html view, on example for index action:
2.Add route for
rendered_images3.Add render image action in application controller
I haven’t tested it. I hope it will give you something to start with!