views:

13

answers:

0
def create
@asset = Asset.new(params[:asset])

respond_to do |format|
  if params[:Filedata]
    @asset = Asset.new :swf_uploaded_data => params[:Filedata]
    @asset.user = current_user
    @asset.save!

    format.html { render :text => @asset.image.url(:thumb) }
    format.xml  { render :nothing => true }

  else
    if @asset.save
      flash[:notice] = 'Created'
      format.html { redirect_to(@asset) }
      format.xml  { render :xml => @asset, :status => :created, :location => @asset }
    else
      format.html { render :action => "new" }
      format.xml  { render :xml => @asset.errors, :status => :unprocessable_entity }
    end
  end
end
end

I am creating an upload status bar with swfupload. At the end of the upload I get a 406 error.