Douglas Tan
2006-Jan-09 03:42 UTC
[Rails] form with more than 1 file upload field saves 0 byte file for 1 file field
Im using the file_column plugin to upload files from my application. The problem I am encountering is that I have a form with 2 file upload fields and when I submnit that form with files selected, I would get a message from the browser(Firefox) saying that a script on the page is taking a long time to execute and whether I want to cancel it or continue. Whichever option I choose, only 1 file(PDF) is uploaded fully to the server while the other(Image) has a filesystem entry but its 0 bytes. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060109/9a4a64b3/attachment-0001.html
Kyle Maxwell
2006-Jan-09 18:29 UTC
[Rails] form with more than 1 file upload field saves 0 byte file for 1 file field
On 1/8/06, Douglas Tan <bianster@gmail.com> wrote:> Im using the file_column plugin to upload files from my application. The > problem I am encountering is that I have a form with 2 file upload fields > and when I submnit that form with files selected, I would get a message from > the browser(Firefox) saying that a script on the page is taking a long time > to execute and whether I want to cancel it or continue. Whichever option I > choose, only 1 file(PDF) is uploaded fully to the server while the > other(Image) has a filesystem entry but its 0 bytes. > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >Can you run the unit tests that come with file_column? I know that there is test coverage for that problem. Let us know if it passes on your server. -- Kyle Maxwell Chief Technologist E Factor Media // FN Interactive kyle@efactormedia.com 1-866-263-3261
Douglas Tan
2006-Jan-10 13:10 UTC
[Rails] form with more than 1 file upload field saves 0 byte file for 1 file field
I ran the tests and here''s the output: Using native MySQL ./abstract_unit.rb:20: warning: already initialized constant DEFAULT_OPTIONS Loaded suite file_column_test Started .............F....F.............................E.F..... Finished in 1.693641 seconds. 1) Failure: test_default_options(FileColumnTest) [file_column_test.rb:46]: <"./public/uploads/entry/image"> expected to be =~ </\/public\/entry\/image/>. 2) Failure: test_dir_methods(FileColumnTest) [file_column_test.rb:178]: <"/home/douglas/public_html/flare/vendor/plugins/file_column/test/public/entry/image/10"> expected but was <"/home/douglas/public_html/flare/vendor/plugins/file_column/test/public/uploads/entry/image/10">. 3) Error: test_store_dir_callback(FileColumnTest): TypeError: can''t convert Fixnum into String file_column_test.rb:191:in `join'' file_column_test.rb:191:in `test_store_dir_callback'' 4) Failure: test_tmp_dir_with_store_dir_callback(FileColumnTest) [file_column_test.rb:199]: <"/home/douglas/public_html/flare/vendor/plugins/file_column/test/public/my_store_dir/tmp"> expected but was <"/home/douglas/public_html/flare/vendor/plugins/file_column/test/public/uploads/my_store_dir/tmp">. 56 tests, 173 assertions, 3 failures, 1 errors The test with 2 file columns seems to pass so i''m baffled by this. On 1/9/06, Kyle Maxwell <kyle@kylemaxwell.com> wrote:> > On 1/8/06, Douglas Tan <bianster@gmail.com> wrote: > > Im using the file_column plugin to upload files from my application. The > > problem I am encountering is that I have a form with 2 file upload > fields > > and when I submnit that form with files selected, I would get a message > from > > the browser(Firefox) saying that a script on the page is taking a long > time > > to execute and whether I want to cancel it or continue. Whichever option > I > > choose, only 1 file(PDF) is uploaded fully to the server while the > > other(Image) has a filesystem entry but its 0 bytes. > > > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > Can you run the unit tests that come with file_column? I know that > there is test coverage for that problem. Let us know if it passes on > your server. > > -- > Kyle Maxwell > Chief Technologist > E Factor Media // FN Interactive > kyle@efactormedia.com > 1-866-263-3261 > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060110/3d8384c9/attachment-0001.html
Kyle Maxwell
2006-Jan-10 21:29 UTC
[Rails] form with more than 1 file upload field saves 0 byte file for 1 file field
On 1/10/06, Douglas Tan <bianster@gmail.com> wrote:> I ran the tests and here''s the output: > > Using native MySQL > ./abstract_unit.rb:20: warning: already initialized constant > DEFAULT_OPTIONS > Loaded suite file_column_test > Started > .............F....F.............................E.F..... > Finished in 1.693641 seconds. > > 1) Failure: > test_default_options(FileColumnTest) > [file_column_test.rb:46]: > <"./public/uploads/entry/image"> expected to be =~ > </\/public\/entry\/image/>. > > 2) Failure: > test_dir_methods(FileColumnTest) > [file_column_test.rb:178]: > <"/home/douglas/public_html/flare/vendor/plugins/file_column/test/public/entry/image/10"> > expected but was > <"/home/douglas/public_html/flare/vendor/plugins/file_column/test/public/uploads/entry/image/10">. > > 3) Error: > test_store_dir_callback(FileColumnTest): > TypeError: can''t convert Fixnum into String > file_column_test.rb:191:in `join'' > file_column_test.rb:191:in `test_store_dir_callback'' > > 4) Failure: > test_tmp_dir_with_store_dir_callback(FileColumnTest) > [file_column_test.rb:199]: > <"/home/douglas/public_html/flare/vendor/plugins/file_column/test/public/my_store_dir/tmp"> > expected but was > <"/home/douglas/public_html/flare/vendor/plugins/file_column/test/public/uploads/my_store_dir/tmp">. > > 56 tests, 173 assertions, 3 failures, 1 errors > > The test with 2 file columns seems to pass so i''m baffled by this. > > > > On 1/9/06, Kyle Maxwell <kyle@kylemaxwell.com> wrote: > > On 1/8/06, Douglas Tan <bianster@gmail.com> wrote: > > > Im using the file_column plugin to upload files from my application. The > > > problem I am encountering is that I have a form with 2 file upload > fields > > > and when I submnit that form with files selected, I would get a message > from > > > the browser(Firefox) saying that a script on the page is taking a long > time > > > to execute and whether I want to cancel it or continue. Whichever option > I > > > choose, only 1 file(PDF) is uploaded fully to the server while the > > > other(Image) has a filesystem entry but its 0 bytes. > > > > > > _______________________________________________ > > > Rails mailing list > > > Rails@lists.rubyonrails.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > > > > > Can you run the unit tests that come with file_column? I know that > > there is test coverage for that problem. Let us know if it passes on > > your server. > > > > -- > > Kyle Maxwell > > Chief Technologist > > E Factor Media // FN Interactive > > kyle@efactormedia.com > > 1-866-263-3261 > > > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >Have you tried different browsers and web servers? -- Kyle Maxwell Chief Technologist E Factor Media // FN Interactive kyle@efactormedia.com 1-866-263-3261
Douglas Tan
2006-Jan-11 02:48 UTC
[Rails] form with more than 1 file upload field saves 0 byte file for 1 file field
I have the same problem when performing uploads on my development machine, the results from the file_column_test.rb are similar to the ones on the live server. I''ve tried Firefox, IE and Opera, the results are the same though On 1/11/06, Kyle Maxwell <kyle@kylemaxwell.com> wrote:> > On 1/10/06, Douglas Tan <bianster@gmail.com> wrote: > > I ran the tests and here''s the output: > > > > Using native MySQL > > ./abstract_unit.rb:20: warning: already initialized constant > > DEFAULT_OPTIONS > > Loaded suite file_column_test > > Started > > .............F....F.............................E.F..... > > Finished in 1.693641 seconds. > > > > 1) Failure: > > test_default_options(FileColumnTest) > > [file_column_test.rb:46]: > > <"./public/uploads/entry/image"> expected to be =~ > > </\/public\/entry\/image/>. > > > > 2) Failure: > > test_dir_methods(FileColumnTest) > > [file_column_test.rb:178]: > > > <"/home/douglas/public_html/flare/vendor/plugins/file_column/test/public/entry/image/10"> > > expected but was > > > <"/home/douglas/public_html/flare/vendor/plugins/file_column/test/public/uploads/entry/image/10">. > > > > 3) Error: > > test_store_dir_callback(FileColumnTest): > > TypeError: can''t convert Fixnum into String > > file_column_test.rb:191:in `join'' > > file_column_test.rb:191:in `test_store_dir_callback'' > > > > 4) Failure: > > test_tmp_dir_with_store_dir_callback(FileColumnTest) > > [file_column_test.rb:199]: > > > <"/home/douglas/public_html/flare/vendor/plugins/file_column/test/public/my_store_dir/tmp"> > > expected but was > > > <"/home/douglas/public_html/flare/vendor/plugins/file_column/test/public/uploads/my_store_dir/tmp">. > > > > 56 tests, 173 assertions, 3 failures, 1 errors > > > > The test with 2 file columns seems to pass so i''m baffled by this. > > > > > > > > On 1/9/06, Kyle Maxwell <kyle@kylemaxwell.com> wrote: > > > On 1/8/06, Douglas Tan <bianster@gmail.com> wrote: > > > > Im using the file_column plugin to upload files from my application. > The > > > > problem I am encountering is that I have a form with 2 file upload > > fields > > > > and when I submnit that form with files selected, I would get a > message > > from > > > > the browser(Firefox) saying that a script on the page is taking a > long > > time > > > > to execute and whether I want to cancel it or continue. Whichever > option > > I > > > > choose, only 1 file(PDF) is uploaded fully to the server while the > > > > other(Image) has a filesystem entry but its 0 bytes. > > > > > > > > _______________________________________________ > > > > Rails mailing list > > > > Rails@lists.rubyonrails.org > > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > > > > > > > > > > Can you run the unit tests that come with file_column? I know that > > > there is test coverage for that problem. Let us know if it passes on > > > your server. > > > > > > -- > > > Kyle Maxwell > > > Chief Technologist > > > E Factor Media // FN Interactive > > > kyle@efactormedia.com > > > 1-866-263-3261 > > > > > > _______________________________________________ > > > Rails mailing list > > > Rails@lists.rubyonrails.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > > > > > > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > Have you tried different browsers and web servers? > > -- > Kyle Maxwell > Chief Technologist > E Factor Media // FN Interactive > kyle@efactormedia.com > 1-866-263-3261 > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060111/c026a218/attachment.html
Douglas Tan
2006-Jan-11 09:36 UTC
[Rails] form with more than 1 file upload field saves 0 byte file for 1 file field
okay, i found out what the problem was, as the files were being saved with 0600, I added an after_save handler to the model classes and set the file permissions to 0644. I think I was overriding file_column''s after save handler and causing the issue. On 1/11/06, Douglas Tan <bianster@gmail.com> wrote:> > I have the same problem when performing uploads on my development machine, > the results from the file_column_test.rb are similar to the ones on the live > server. I''ve tried Firefox, IE and Opera, the results are the same though > > On 1/11/06, Kyle Maxwell <kyle@kylemaxwell.com> wrote: > > > > On 1/10/06, Douglas Tan <bianster@gmail.com> wrote: > > > I ran the tests and here''s the output: > > > > > > Using native MySQL > > > ./abstract_unit.rb:20: warning: already initialized constant > > > DEFAULT_OPTIONS > > > Loaded suite file_column_test > > > Started > > > .............F....F.............................E.F..... > > > Finished in 1.693641 seconds. > > > > > > 1) Failure: > > > test_default_options(FileColumnTest) > > > [file_column_test.rb:46]: > > > <"./public/uploads/entry/image"> expected to be =~ > > > </\/public\/entry\/image/>. > > > > > > 2) Failure: > > > test_dir_methods(FileColumnTest) > > > [file_column_test.rb:178]: > > > > > <"/home/douglas/public_html/flare/vendor/plugins/file_column/test/public/entry/image/10"> > > > expected but was > > > > > <"/home/douglas/public_html/flare/vendor/plugins/file_column/test/public/uploads/entry/image/10">. > > > > > > > > 3) Error: > > > test_store_dir_callback(FileColumnTest): > > > TypeError: can''t convert Fixnum into String > > > file_column_test.rb:191:in `join'' > > > file_column_test.rb:191:in `test_store_dir_callback'' > > > > > > 4) Failure: > > > test_tmp_dir_with_store_dir_callback(FileColumnTest) > > > [file_column_test.rb:199]: > > > > > <"/home/douglas/public_html/flare/vendor/plugins/file_column/test/public/my_store_dir/tmp"> > > > > > expected but was > > > > > <"/home/douglas/public_html/flare/vendor/plugins/file_column/test/public/uploads/my_store_dir/tmp">. > > > > > > 56 tests, 173 assertions, 3 failures, 1 errors > > > > > > The test with 2 file columns seems to pass so i''m baffled by this. > > > > > > > > > > > > On 1/9/06, Kyle Maxwell <kyle@kylemaxwell.com> wrote: > > > > On 1/8/06, Douglas Tan < bianster@gmail.com> wrote: > > > > > Im using the file_column plugin to upload files from my > > application. The > > > > > problem I am encountering is that I have a form with 2 file upload > > > > > fields > > > > > and when I submnit that form with files selected, I would get a > > message > > > from > > > > > the browser(Firefox) saying that a script on the page is taking a > > long > > > time > > > > > to execute and whether I want to cancel it or continue. Whichever > > option > > > I > > > > > choose, only 1 file(PDF) is uploaded fully to the server while the > > > > > other(Image) has a filesystem entry but its 0 bytes. > > > > > > > > > > _______________________________________________ > > > > > Rails mailing list > > > > > Rails@lists.rubyonrails.org > > > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > > > > > > > > > > > > > > > Can you run the unit tests that come with file_column? I know that > > > > there is test coverage for that problem. Let us know if it passes on > > > > your server. > > > > > > > > -- > > > > Kyle Maxwell > > > > Chief Technologist > > > > E Factor Media // FN Interactive > > > > kyle@efactormedia.com > > > > 1-866-263-3261 > > > > > > > > _______________________________________________ > > > > Rails mailing list > > > > Rails@lists.rubyonrails.org > > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > Rails mailing list > > > Rails@lists.rubyonrails.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > > > > > Have you tried different browsers and web servers? > > > > -- > > Kyle Maxwell > > Chief Technologist > > E Factor Media // FN Interactive > > kyle@efactormedia.com > > 1-866-263-3261 > > > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060111/dbb8f81a/attachment.html