2010-09-09 110 views
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 

我正在用swfupload创建一个上传状态栏。在上传结束时,我收到了一个406错误。swfupload 406不可接受的错误

回答

1

不一定是你的答案,但我有Plupload同样的问题,它发生的请求格式是零。 它可能不是最好的方式,但一个可以做到以下几点:

request.format ||= :xml 

,以提供在该方法的一些默认格式。希望它能帮助别人。

相关问题