Image upload

ok, im done, the plugins file_column and acts_as_attachment doesnt seems
to work for me, i want a simple thing, upload images, resize it to 216px
width, save its filename to a table and save the file to the
/public/images directory, i have searched a lot but all the examples are
too complex, im starting with rails.

If someone can post a example code for the view, controller and model(if
any) that will be very apreciated, i really have tried without success,
hope someone can help with this.

regards, Remy.

Remy Lopez wrote:

ok, im done, the plugins file_column and acts_as_attachment doesnt seems
to work for me, i want a simple thing, upload images, resize it to 216px
width, save its filename to a table and save the file to the
/public/images directory, i have searched a lot but all the examples are
too complex, im starting with rails.

If someone can post a example code for the view, controller and model(if
any) that will be very apreciated, i really have tried without success,
hope someone can help with this.

regards, Remy.

Hey, I understand your pain!

I’m leaving this until I have finished building my app and hopefully by
then I will have figured it out.

Don’t crack gentlemen :slight_smile:

First of all file_column is perfectly fit as your solution. but there
are no good explanations indeed.
send me a mail with your code and i will help you do this.

acts as attachment is a real simple way to upload images. why does not
it work for you?

please paste some code, it’s easier to help you in that way.
it’s not a Rmagick problem, i resize images sized over 10MB with no
problems

On 20 Dec 2006, at 17:03, mixplate wrote:

acts as attachment is a real simple way to upload images. why does
not it work for you?

It worked fine for me until yesterday. As soon as I upload an image
of more than 700 KB and resize it, something goes wrong. The original
large image is kept, stored without a content_type, it’s not resized
and no thumbnails were generated. The images are all an original
nikon digital camera shot, the files range from 700-1024 KB.

We’ve replaced RMagick with MiniMagick, thinking it was somehow
related to memory usage (even though I am still testing on a
PowerBook with 1 GB of RAM, so RAM shouldn’t be a problem), but it
wasn’t. Just running the mogrify (ImageMagick) command through the
command line resized the image without a problem. Somehow I get a
feeling it’s not acts_as_attachment related, but I have no idea where
to look anymore.

And yes, I really need to be able to support resizing very large
images :slight_smile:

Best regards

Peter De Berdt

Did you view source on the form? According to the docs, you pass the
“:multipart => true” in as a hash, change that and you will be fine. As
for
the image changes with file_column, in your model put, file_column
:some_column, :magick => { :geometry => ‘100x100’ }

kris wrote:

Did you view source on the form? According to the docs, you pass the
“:multipart => true” in as a hash, change that and you will be fine. As
for
the image changes with file_column, in your model put, file_column
:some_column, :magick => { :geometry => ‘100x100’ }

No action responded? he might coded the multipart definition the wrong
way.
this works for me:

<%= start_form_tag {:action => ‘action’ }, {:multipart => true } %>

Elad M. - Creopolis.com wrote:

please paste some code, it’s easier to help you in that way.
it’s not a Rmagick problem, i resize images sized over 10MB with no
problems

Elad - I am totally new to rails and I am trying to get file_column to
work. I got to the point where I can select a file to upload, but then
I get an error
“No action responded to do_image_upload” when I try to upload the file

I assume that is coming from this line in my new.rhtml

<%= form_tag( { :action => ‘do_image_upload’ }, :multipart => true ) %>

Here is the whole new.rhtml

New product

<%= form_tag( { :action => ‘do_image_upload’ }, :multipart => true ) %>

<%= start_form_tag :action => ‘create’ %>
<%= render :partial => ‘form’ %>
<%= submit_tag “Create” %>
<%= end_form_tag %>

<%= link_to ‘Back’, :action => ‘list’ %>

I figure it is failing when trying to call do_image_upload, but I don’t
know what to do there. Do I have to create the function
do_image_upload? Any help you can provide would be greatly appreciated.
I have gone to a bunch of sites trying to find this out, but none of the
sites really explain this fully.

Thanks,
Paul

I got the error “No Action Responded” when I didn’t setup the multipart
correctly