Forum: Ruby on Rails File_Column problem with form redisplay

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
wilfordbrimley (Guest)
on 2006-12-24 01:58
(Received via mailing list)
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:in `fu_mkdir'
    /usr/local/lib/ruby/1.8/fileutils.rb:172:in `mkdir'
    /usr/local/lib/ruby/1.8/fileutils.rb:171:in `mkdir'
    /vendor/plugins/file_column/lib/magick_file_column.rb:20:in
`transform_with_magick'
    /vendor/plugins/file_column/lib/magick_file_column.rb:17:in
`transform_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:in `image='
    /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:in `welcome'

/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:in `measure'

/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:in `each_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)
AJAY A (Guest)
on 2006-12-24 10:13
(Received via mailing list)
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
This topic is locked and can not be replied to.