Hi,
I wand to give a preview of the just uploaded pictures. These pictures are not saved in the public folder, as they are not public...
How can I do this?
Thanks Markus
Hi,
I wand to give a preview of the just uploaded pictures. These pictures are not saved in the public folder, as they are not public...
How can I do this?
Thanks Markus
You could:
1) Create symlink to the images in the public folder?
2) As you are using the images publicly, they should really be in the public folder - why are they currently not?
You need create a Controller to send_file ( http://api.rubyonrails.org/classes/ActionController/Streaming.html#method-i-send_file ) it.
class AvatarsController
def show
send_file my_avatar_path, :type => 'image/jpeg', :disposition => 'inline'
end
end
In this controller you can add all authorization you want.