I am having a slight problem with file_column. I''ve defined everything according to the documentation but for some odd reason, only the tmp files are being uploaded. the permanent ones are never created. my Model code: class User < ActiveRecord::Base file_column :image, :store_dir => ''public/users'', :magick => { :versions => { ''thumb'' => ''50>'', ''profile'' => ''200>'' } } end my View code: <%= file_column_field ''user'', ''image'' %> <% if not @user.image.nil? %> <div id="profileImage"><%= image_tag url_for_file_column("user", "image", "profile"), :alt => @user.login %></div> <% end %> All view code works just fine and the actual image tag is created with the proper image path. but the image doesn''t exist in that path cause it''s never created (or moved/copied from the tmp folder) my Table column definition for image: image VARCHAR(50) default NULL, These files get created just fine: $RAILS_ROOT/public/users/tmp/<random>/filename.ext $RAILS_ROOT/public/users/tmp/<random>/filename-profile.ext $RAILS_ROOT/public/users/tmp/<random>/filename-thumb.ext But, they are never moved/copied to the permanent location of $RAILS_ROOT/public/users/<model-name>/<object.id <http://object.id>>/filename.extWhat''s going on here?! I don''t think its a problem with permissions, cause i''m running Webrick and the tmp folder and files get created just fine. -- - Ramin http://www.getintothis.com/blog _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Hmmm.. I decided to make my Profile object have the image column as opposed to my User object and everything seems to be working fine now. I don''t understand why though. All I did was set the image column to the Profile model instead of the User model. Very strange. On 11/18/05, Ramin <i8ramin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > I am having a slight problem with file_column. I''ve defined everything > according to the documentation but for some odd reason, only the tmp files > are being uploaded. the permanent ones are never created. > > my Model code: > class User < ActiveRecord::Base > file_column :image, :store_dir => ''public/users'', :magick => { :versions > => { ''thumb'' => ''50>'', ''profile'' => ''200>'' } } > end > > my View code: > <%= file_column_field ''user'', ''image'' %> > > <% if not @user.image.nil? %> > <div id="profileImage"><%= image_tag url_for_file_column("user", "image", > "profile"), :alt => @user.login %></div> > <% end %> > > All view code works just fine and the actual image tag is created with the > proper image path. but the image doesn''t exist in that path cause it''s never > created (or moved/copied from the tmp folder) > > my Table column definition for image: > image VARCHAR(50) default NULL, > > > These files get created just fine: > $RAILS_ROOT/public/users/tmp/<random>/filename.ext > $RAILS_ROOT/public/users/tmp/<random>/filename-profile.ext > $RAILS_ROOT/public/users/tmp/<random>/filename-thumb.ext > > But, they are never moved/copied to the permanent location of > $RAILS_ROOT/public/users/<model-name>/<object.id <http://object.id> > >/filename.ext > > What''s going on here?! I don''t think its a problem with permissions, cause > i''m running Webrick and the tmp folder and files get created just fine. > > -- > - Ramin > http://www.getintothis.com/blog-- - Ramin http://www.getintothis.com/blog _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
my wild newbie guess would be that perhaps there''s some conflict with using "image" as the "user" file_column, for some reason? I seem to remember having problems before using "file" as the file_column, and having to change it to another name. 2005/11/18, Ramin <i8ramin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:> Hmmm.. I decided to make my Profile object have the image column as opposed > to my User object and everything seems to be working fine now. I don''t > understand why though. All I did was set the image column to the Profile > model instead of the User model. Very strange. > > > > On 11/18/05, Ramin <i8ramin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > I am having a slight problem with file_column. I''ve defined everything > according to the documentation but for some odd reason, only the tmp files > are being uploaded. the permanent ones are never created. > > > > my Model code: > > class User < ActiveRecord::Base > > file_column :image, :store_dir => ''public/users'', :magick => { :versions > => { ''thumb'' => ''50>'', ''profile'' => ''200>'' } } > > end > > > > my View code: > > <%= file_column_field ''user'', ''image'' %> > > > > <% if not @user.image.nil? %> > > <div id="profileImage"><%= image_tag url_for_file_column("user", > "image", "profile"), :alt => @user.login %></div> > > <% end %> > > > > All view code works just fine and the actual image tag is created with the > proper image path. but the image doesn''t exist in that path cause it''s never > created (or moved/copied from the tmp folder) > > > > my Table column definition for image: > > image VARCHAR(50) default NULL, > > > > > > These files get created just fine: > > $RAILS_ROOT/public/users/tmp/<random>/filename.ext > > > $RAILS_ROOT/public/users/tmp/<random>/filename-profile.ext > > > $RAILS_ROOT/public/users/tmp/<random>/filename-thumb.ext > > > > But, they are never moved/copied to the permanent location of > > > $RAILS_ROOT/public/users/<model-name>/<object.id>/filename.ext > > > > What''s going on here?! I don''t think its a problem with permissions, cause > i''m running Webrick and the tmp folder and files get created just fine. > > > > -- > > - Ramin > > http://www.getintothis.com/blog > > > > -- > - Ramin > http://www.getintothis.com/blog > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >