Quick Question. I understand how to change the default path to
something other than public but what if I wanted to add another
directory into the equation. I want to upload an image into the
following structure:
/public/image/userid/imageid/test.gif
So basically I want to look up the userid in my users table and put
all the images for that user in the same directory. So i have a one
more level of separation. The reason being that we want to have a
bandwidth cap put on download for our app. We are doing this via
virtual’s set on the server however with all the virtuals pointing to
the same place it is possible for a malicious user to find out
another virtuals name and use that as a workaround to their bandwidth
constraint. Is it possible? has anyone else tried this?
This certainly isn’t a concise answer to your query, but I needed to do
several things with uploaded images, beyond what file_column provided.
I’m
just gonna paste stuff right out of my Registrant model rather than try
to
figure out how to make it generic for you…
def save_image(image_to_crop, crop_params)
img_base = RAILS_ROOT + “/public/images/registrants/”
img_filename = self.id.to_s + “.jpg”
y, x, w, h = crop_params.split(’,’)
Well I have not looked into it yet. But the trunk version of
file_column will allow me to do what I want to do, while lighty does
not support the throttling that we are looking to do. We are still
trying to find a webserver that will and that also supports rails.
I’ll have to go and grab the trunk version of file column.
Andrew
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.