我正在驗證Carrierwave上傳的大小。它非常好於本地主機,但服務器(亞馬遜EC2)我收到以下錯誤,當我嘗試上傳的文件大於1MB(這是限制):驗證Carrierwave上傳的大小
POST http://mysubdomain.mysite.com/authors/484.js /authors/484.js:1
Unsafe JavaScript attempt to access frame with URL data:text/html,chromewebdata from frame with URL http://mysubdomain.mysite.com/. The frame requesting access has a protocol of 'http', the frame being accessed has a protocol of ''. Protocols must match.
default.js:17
484.js /authors POST (failed) Pending Other 13 B 0 B 1.0 min
data:image/png;base… GET Success image/png data:text/html,chromewebdata:159 Parser 0 B 2.3 KB 0 ms 0 0 ms
在行default.js: 17,當錯誤發生時我看到jQuery代碼(精縮)
這是怎麼了驗證圖像:
mount_uploader :image_one, AuthorPixUploader
validates :image_one,
:file_size => {
:maximum => 1.megabytes.to_i
}
任何幫助嗎?我認爲它在失敗到達服務器之前失敗。我不知道。