Hello, I have been trying for some time to get a file to upload using the file_column plugin. My code is here: http://pastie.caboo.se/7304 But my code is not the issue. I cannot even pass the unit test that come with the file_column plugin. If I run ruby file_column_test.rb i get: 1) Error: test_store_dir_callback(FileColumnTest): TypeError: can''t convert Fixnum into String file_column_test.rb:204:in `join'' file_column_test.rb:204:in `test_store_dir_callback'' If I run the rmagick tester file, I get 6 failures. Is it possible that rmagick would keep file_column from functioning at all? When I try to upload a file, it just passes null to the DB and doesn''t even download the file to the /tmp folder. Any suggestions would be great. I will be working on trying to see if rmagick is working or not, but I doubt that would keep the file from uploading at all. Thanx for you time. -- :// Nathan Herald
On 04/08/06, Nathan Herald <myobie@gmail.com> wrote:> > 1) Error: > test_store_dir_callback(FileColumnTest): > TypeError: can''t convert Fixnum into String > file_column_test.rb:204:in `join'' > file_column_test.rb:204:in `test_store_dir_callback''I think it ought to read: assert_equal_paths File.join(RAILS_ROOT, "public", "my_store_dir", e.id.to_s), e.image_dir In lieu of assert_equal_paths File.join(RAILS_ROOT, "public", "my_store_dir", e.id), e.image_dir The svn diff is stored at http://prolificprogrammer.com/~hdiwan/file_column.patch -- Cheers, Hasan Diwan <hasan.diwan@gmail.com> -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060805/66674e9f/attachment.html
On 2006-08-05 17:35:06 -0400, "Hasan Diwan" <hasan.diwan@gmail.com> said:> I think it ought to read: > assert_equal_paths File.join(RAILS_ROOT, "public", "my_store_dir", e.id.to_s), > e.image_dirThanx for that. I now pass every test but one, actually uploading a file. It never actually takes the file from my hard drive. 1) Failure: test_with_image_tag(UrlForFileColumnTest) [file_column_helper_test.rb:80]: <"/foo/bar/entry/image/tmp/1154962075.100369.19508/skanthak.png?1154962075"> expected to be =~ </^\/foo\/bar\/entry\/image\/.+\/skanthak.png$/>. When I try to write my own rails app to upload a file, it doesn''t even return a tmp directory... I am going to have to roll my own now, but I really like the way file_column handles uploads. If anyone has any suggestions, thanx. -- :// Nathan Herald
I have a feeling that it is as simple as your multipart isn''t working. Try this: <%= start_form_tag({:action => ''create''}, :multipart => true)%> It seems dumb, but from the looks of your Firefox output, the multipart is being passed as a parameter. Look at the actual HTML that is being produced to verify that the form tag is being built properly. On 8/7/06, Nathan Herald <myobie@gmail.com> wrote:> On 2006-08-05 17:35:06 -0400, "Hasan Diwan" > <hasan.diwan@gmail.com> said: > > > I think it ought to read: > > assert_equal_paths File.join(RAILS_ROOT, "public", "my_store_dir", e.id.to_s), > > e.image_dir > > Thanx for that. I now pass every test but one, actually uploading a > file. It never actually takes the file from my hard drive. > > 1) Failure: > test_with_image_tag(UrlForFileColumnTest) [file_column_helper_test.rb:80]: > <"/foo/bar/entry/image/tmp/1154962075.100369.19508/skanthak.png?1154962075"> > expected to be =~ > </^\/foo\/bar\/entry\/image\/.+\/skanthak.png$/>. > > When I try to write my own rails app to upload a file, it doesn''t even > return a tmp directory... > > I am going to have to roll my own now, but I really like the way > file_column handles uploads. > > If anyone has any suggestions, thanx. > -- > > :// > Nathan Herald > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
On 2006-08-07 11:35:35 -0400, "Carl Fyffe" <carl.fyffe@gmail.com> said:> I have a feeling that it is as simple as your multipart isn''t working.It''s one of those things isn''t it. I noticed that too and repaired it. Thanx. It wasn''t the only problem I had left. I had a bad install of image magick and had to reinstall it, but I got er workin. There needs to be a gem install all_the_crap_i_need_for_me ;) -- :// Nathan Herald
Reasonably Related Threads
- form with more than 1 file upload field saves 0 byte file for 1 file field
- url_for_file_column not returning correct path
- Anyone got a copy of File_Column trunk
- Accessing model attributes in ActiveSupport::Concern module
- BUGS n code generated for target i386 compiling __bswapdi3, and for target x86-64 compiling __bswapsi2()