2010-09-09 109 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 

,以提供在該方法的一些默認格式。希望它能幫助別人。

相關問題