Adding image uploads to custom extension


#1

Could anyone provide some direction in adding something like this? I’m
guessing I would have to use the attachment_fu plugin but I’m not sure
how to integrate this with Radiant.


#2

Little K. wrote:

Could anyone provide some direction in adding something like this? I’m
guessing I would have to use the attachment_fu plugin but I’m not sure
how to integrate this with Radiant.

Would it help to look at the code for Radiant Gallery or
PageAttachments? Both use attachment_fu

Cheers,
Mohit.
1/24/2009 | 12:11 AM.


#3

Little K. wrote:

Could anyone provide some direction in adding something like this? I’m
guessing I would have to use the attachment_fu plugin but I’m not sure
how to integrate this with Radiant.

I recently switched one of my non-Radiant projects from attachment_fu
over to paperclip, and I must say I’m very pleased. I highly recommend
it.

Sean


#4

Sean C. wrote:

Little K. wrote:

Could anyone provide some direction in adding something like this? I’m
guessing I would have to use the attachment_fu plugin but I’m not sure
how to integrate this with Radiant.

I recently switched one of my non-Radiant projects from attachment_fu
over to paperclip, and I must say I’m very pleased. I highly recommend
it.

Sean

Well I’ve tried adding paperclip to my Radiant site but I’ve hit a snag.

paperclip plugin is in vendor/plugins

player.rb

has_attached_file :photo,
:styles => {
:thumb=> “100x100#”,
:small => “150x150>”,
:medium => “300x300>”,
:large => “400x400>” }

player/app/views/admin/edit.html.erb

<% form_for :player, :html => { :multipart => true } do |f|%>


<%= f.file_field :photo %>


<% end %>

The file field shows up fine, but I get this error when I try uploading
an image:

“Validation errors occurred while processing this form…”

and underneath the browse/upload part it says:
• could not be processed because the file does not exist.

Any ideas, Sean?


#5

Little K. wrote:

player.rb

has_attached_file :photo,
:styles => {
:thumb=> “100x100#”,
:small => “150x150>”,
:medium => “300x300>”,
:large => “400x400>” }

If I change this to just has_attached_file :photo, everything works,
which leads me to believe image processing is not setup correctly on my
machine.

I downloaded the latest ImageMagick binary from their website (dll
version) and ran the installer but it appears that isn’t all you need to
do? (Windows, unfortunately)