您好除了IE之外还在所有其他浏览器上与paperclip集成。我可以找出问题所在。
以下是工作和不工作的日志
工作(Firefox)
Started POST "/submit" for 192.168.2.4 at 2012-02-16 08:13:21 +0800
Processing by HomeController#submit as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"xTBkKxA43DB1BNaGVY0Y2+95f9wuJHHkflJEaWRmURw=", "entry"=>{"user_id"=>"1", "photo"=>#<ActionDispatch::Http::UploadedFile:0x007fb5903e08d0 @original_filename="Screen Shot 2012-02-14 at 9.52.25 AM.png", @content_type="image/png", @headers="Content-Disposition: form-data; name=\"entry[photo]\"; filename=\"Screen Shot 2012-02-14 at 9.52.25 AM.png\"\r\nContent-Type: image/png\r\n", @tempfile=#<File:/var/folders/5z/v8ld__9x4w97w0j28zc9dtyh0000gn/T/RackMultipart20120216-3442-18qvmga>>, "your_name"=>"test", "email"=>"abc@gmail.com", "their_name"=>"name, name2", "story"=>"test test"}}
User Load (0.5ms) SELECT `users`.* FROM `users` WHERE `users`.`active` = 1 AND `users`.`id` = 1 AND `users`.`facebook_id` = '72XXXXX21' LIMIT 1
CACHE (0.0ms) SELECT `users`.* FROM `users` WHERE `users`.`active` = 1 AND `users`.`id` = 1 AND `users`.`facebook_id` = '72XXXXX21' LIMIT 1
Command :: identify -format %wx%h '/var/folders/5z/v8ld__9x4w97w0j28zc9dtyh0000gn/T/stream20120216-3442-1fnstu2.png[0]'
Command :: convert '/var/folders/5z/v8ld__9x4w97w0j28zc9dtyh0000gn/T/stream20120216-3442-1fnstu2.png[0]' -resize "350x350>" '/var/folders/5z/v8ld__9x4w97w0j28zc9dtyh0000gn/T/stream20120216-3442-1fnstu220120216-3442-uow6r1'
Command :: identify -format %wx%h '/var/folders/5z/v8ld__9x4w97w0j28zc9dtyh0000gn/T/stream20120216-3442-1fnstu2.png[0]'
Command :: convert '/var/folders/5z/v8ld__9x4w97w0j28zc9dtyh0000gn/T/stream20120216-3442-1fnstu2.png[0]' -resize "110x110>" '/var/folders/5z/v8ld__9x4w97w0j28zc9dtyh0000gn/T/stream20120216-3442-1fnstu220120216-3442-yqy983'
(0.2ms) BEGIN
SQL (0.3ms) INSERT INTO `entries` (`created_at`, `email`, `isapproved`, `photo_content_type`, `photo_file_name`, `photo_file_size`, `photo_updated_at`, `story`, `their_name`, `updated_at`, `user_id`, `your_name`) VALUES ('2012-02-16 00:13:22', 'zeya.min@gmail.com', 0, 'image/png', 'Screen_Shot_2012-02-14_at_9.52.25_AM.png', 354645, '2012-02-16 00:13:22', 'test test', 'name, name2', '2012-02-16 00:13:22', 1, 'Zeya Phyo')
[paperclip] Saving attachments.
[paperclip] saving /Volumes/z/projectx/github/xxx/public/system/photos/21/original/Screen_Shot_2012-02-14_at_9.52.25_AM.png
[paperclip] saving /Volumes/z/projectx/github/xxx/public/system/photos/21/medium/Screen_Shot_2012-02-14_at_9.52.25_AM.png
[paperclip] saving /Volumes/z/projectx/github/xxx/public/system/photos/21/thumb/Screen_Shot_2012-02-14_at_9.52.25_AM.png
(0.8ms) COMMIT
(0.1ms) BEGIN
[paperclip] Saving attachments.
(0.1ms) COMMIT
不工作(IE 8)
Started POST "/submit" for 192.168.2.2 at 2012-02-16 08:21:27 +0800
Processing by HomeController#submit as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"FZbjiwA49hq/dNYNBvWww9+R1mmF64ZcdogWkTOWF4c=", "entry"=>{"user_id"=>"1", "photo"=>#<ActionDispatch::Http::UploadedFile:0x007fb591a0b510 @original_filename="z_14373-03.jpg", @content_type="image/pjpeg", @headers="Content-Disposition: form-data; name=\"entry[photo]\"; filename=\"z_14373-03.jpg\"\r\nContent-Type: image/pjpeg\r\n", @tempfile=#<File:/var/folders/5z/v8ld__9x4w97w0j28zc9dtyh0000gn/T/RackMultipart20120216-3442-coacoc>>, "your_name"=>"abc", "email"=>"abc@gmail.com", "their_name"=>"diamond", "story"=>"cos it last ....."}}
User Load (0.8ms) SELECT `users`.* FROM `users` WHERE `users`.`active` = 1 AND `users`.`id` = 1 AND `users`.`facebook_id` = '720xxx21' LIMIT 1
CACHE (0.0ms) SELECT `users`.* FROM `users` WHERE `users`.`active` = 1 AND `users`.`id` = 1 AND `users`.`facebook_id` = '720xxx21' LIMIT 1
Command :: identify -format %wx%h '/var/folders/5z/v8ld__9x4w97w0j28zc9dtyh0000gn/T/stream20120216-3442-1hjayq.jpg[0]'
Command :: convert '/var/folders/5z/v8ld__9x4w97w0j28zc9dtyh0000gn/T/stream20120216-3442-1hjayq.jpg[0]' -resize "350x350>" '/var/folders/5z/v8ld__9x4w97w0j28zc9dtyh0000gn/T/stream20120216-3442-1hjayq20120216-3442-qojdnh'
Command :: identify -format %wx%h '/var/folders/5z/v8ld__9x4w97w0j28zc9dtyh0000gn/T/stream20120216-3442-1hjayq.jpg[0]'
Command :: convert '/var/folders/5z/v8ld__9x4w97w0j28zc9dtyh0000gn/T/stream20120216-3442-1hjayq.jpg[0]' -resize "110x110>" '/var/folders/5z/v8ld__9x4w97w0j28zc9dtyh0000gn/T/stream20120216-3442-1hjayq20120216-3442-1yal5cg'
(0.2ms) BEGIN
(0.1ms) ROLLBACK
(0.1ms) BEGIN
(0.1ms) ROLLBACK
答案 0 :(得分:0)
通过IE 8发送的内容类型似乎与'pjpeg'不同
我会检查您的验证,并确保您没有得到可能拒绝此特定类型的验证,或者专门添加它。
因为它正在回滚,我想这是导致它破坏的模型验证问题。