Problem using attachment_fu

Hi,

I use attachment_fu plugin to upload a remote file to file system.

It works fine with IE, If we use fire fox its coming out to login page
throwing a exception
"Filter chain halted as
[#<ActionController::Filters::ClassMethods::SymbolFilter:0xb559a28
@filter=:login_required>] rendered_or_redirected."

I use "acts_as_authenticated" plugin for authentication.

The reason i found is that its not taking the current user id from the
session(Tried hardcoding the user.id in login_from_session method at
authenticated_system module its working fine).

Can some one help me in this issue.

Thanks,
Ratnavel.

Can you post some code?
Your create acion or something?
Oli
Ratnavel P S wrote:

Can you post some code?
Your create acion or something?
Oli

This is my save method where i create a image and upload.

def save_image
    test_image = TestImage.new(:uploaded_data =>
params[:RemoteFile],:user_id => params[:user_id] )

    respond_to do |format|
      if test_image.save
        format.html{render :text=>"Success"}
      else
        format.html{render :text=>"Sorry!,Failed"}
      end
    end
  end

Its actually entering into the method and quiting back bcoz of
authentication issue.

Any help in this regard???

Assuming you are using aaa for auth an you have a relationship set for

user has_many testimages and testimages belongs_to user, try this

def save_image
      test_image = current_user.testimage.create
params[:RemoteFile].merge(:user_id => current_user.id)
      respond_to do |format|
        if test_image.save
          format.html{render :text=>"Success"}
        else
          format.html{render :text=>"Sorry!,Failed"}
        end
      end
    end

Hope this helps

Oli
Ratnavel P S wrote: