Form with more than 1 file upload field saves 0 byte file fo

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.

On 1/8/06, Douglas T. [email protected] wrote:

[email protected]
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 M.
Chief Technologist
E Factor Media // FN Interactive
[email protected]
1-866-263-3261

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:intest_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/10/06, Douglas T. [email protected] wrote:

  1. Failure:
    <“/home/douglas/public_html/flare/vendor/plugins/file_column/test/public/uploads/entry/image/10”>.
    <“/home/douglas/public_html/flare/vendor/plugins/file_column/test/public/my_store_dir/tmp”>

On 1/8/06, Douglas T. [email protected] wrote:

other(Image) has a filesystem entry but its 0 bytes.
there is test coverage for that problem. Let us know if it passes on
Rails mailing list
http://lists.rubyonrails.org/mailman/listinfo/rails

Have you tried different browsers and web servers?


Kyle M.
Chief Technologist
E Factor Media // FN Interactive
[email protected]
1-866-263-3261

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

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.