File_Column problem with form redisplay


#1

I am having the following problem with file_column dieing on a form
redisplay and then resubmit on trying to recreate a directory that was
created with the first submission that didn’t pass validation.
here’s what i get:
Errno::EEXIST in PersonController#start
File exists -
/myproject/public/person/image/tmp/1166911406.72367.14329/small

i have it set up like the following in person.rb:
file_column :image, :magick => { :versions => { “thumb” => “50x50”,
“small” => “200x200”, “medium” => “500x500>” }}

this is the error i’m getting:
Errno::EEXIST (File exists -
/public/…/config/…/public/person/image/tmp/1166911406.72367.14329/small):
/usr/local/lib/ruby/1.8/fileutils.rb:243:in mkdir' /usr/local/lib/ruby/1.8/fileutils.rb:243:infu_mkdir’
/usr/local/lib/ruby/1.8/fileutils.rb:172:in mkdir' /usr/local/lib/ruby/1.8/fileutils.rb:171:inmkdir’
/vendor/plugins/file_column/lib/magick_file_column.rb:20:in
transform_with_magick' /vendor/plugins/file_column/lib/magick_file_column.rb:17:intransform_with_magick’
/vendor/plugins/file_column/lib/magick_file_column.rb:219:in
image_magick_after_assign' /vendor/plugins/file_column/lib/file_column.rb:657:inimage=’
/vendor/plugins/file_column/lib/file_column.rb:656:in `image=’

/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/base.rb:1510:in
`attributes=’

/usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/base.rb:1509:in
attributes=' /app/controllers/person_controller.rb:22:inwelcome’

/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:941:in
`perform_action_without_filters’

/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/filters.rb:368:in
`perform_action_without_benchmark’

/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/benchmarking.rb:69:in
perform_action_without_rescue' /usr/local/lib/ruby/1.8/benchmark.rb:293:inmeasure’

/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/benchmarking.rb:69:in
`perform_action_without_rescue’

/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/rescue.rb:82:in
`perform_action’

/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/base.rb:408:in
`process_without_filters’

/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/filters.rb:377:in
`process_without_session_management_support’

/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/session_management.rb:117:in
`process’

/usr/local/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/dispatcher.rb:38:in
`dispatch’

/usr/local/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/fcgi_handler.rb:150:in
`process_request’

/usr/local/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/fcgi_handler.rb:54:in
process!' /usr/local/lib/ruby/site_ruby/1.8/fcgi.rb:600:ineach_cgi’
/usr/local/lib/ruby/site_ruby/1.8/fcgi.rb:597:in `each_cgi’

/usr/local/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/fcgi_handler.rb:53:in
`process!’

/usr/local/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/fcgi_handler.rb:23:in
`process!’
/myproject/public/dispatch.fcgi:24

Rendering
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.12.5/lib/action_controller/templates/rescues/layout.rhtml
(500 Internal Error)


#2

This is wierd. If you are not doing validation of the content of the
uploaded file itself then it would be sure frustrating to the user to
upload once again.

Anyway… Could you post your view and controller code here?

AJ