【发布时间】:2010-10-19 01:50:18
【问题描述】:
我正在尝试使用 Java Applet 将文件上传到我的 rails 应用程序。但是我不断收到以下错误,我不知道为什么:
Processing CategoriesController#upload_image (for 127.0.0.1 at 2010-10-18 20:32:54) [POST] 参数:{"partitionIndex"=>"0", "fileId"=>"8278320", "lastModified"=>"2010-09-18T14:31:12.610-0500", "fileLength"=>"18571", " fileName"=>"dreamstime_1038438.jpg.zip", "partitionCount"=>"1", "authenticity_token"=>"NHX938BYOQr/B4t1pb4pTMlgEFumfveXGxtROSChJpk=", "file"=>#}
ActionController::InvalidAuthenticityToken (ActionController::InvalidAuthenticityToken): :10:在
synchronize' C:/Ruby/lib/ruby/1.9.1/webrick/httpserver.rb:111:inservice' C:/Ruby/lib/ruby/1.9.1/webrick/httpserver.rb:70:inrun' C:/Ruby/lib/ruby/1.9.1/webrick/server.rb:183:inblock in start_thread'
如上所示,我包含了参数authenticity_token。 authenticity_token 参数由 form_authenticity_token() 生成。在同一个页面中有一个表格,authentity_token 是完全一样的。任何想法我在这里俯瞰什么?
【问题讨论】:
标签: ruby-on-rails security file-upload token applet