I have a file field which accepts multiple files. When I upload a regular file to the field and it passes the check, if I upload the second file which has a virus it won't scan it.

If I upload the first file which has a virus it will pick up the virus and delete the file.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Jing He’s picture

I created a patch against 7.x-1.0-alpha1 to add support for multi-value fields.
This patch uses hook_field_widget_WIDGET_TYPE_form_alter() to add upload_validators to file/image field widgets.
Please test it thoroughly in your environment.

Jing He’s picture

Status: Active » Needs review
manarth’s picture

Status: Needs review » Patch (to be ported)

Great spot, thanks Jing He!

Committed to 7.x-1.x. I've taken the part of your patch which handles the multiple deltas; I haven't changed the function-delegation to use hook_field_widget_WIDGET_TYPE_form_alter just yet (although that's something I'll review for another release).

Thanks again :-)

rooby’s picture

Version: 7.x-1.0-alpha1 » 6.x-1.0-beta2

Since this is committed to D7 this is now for D6.

llillf’s picture

Hi all, is there a patch for D6?

rooby’s picture

Not yet. The patch that was committed to drupal 7 still has to be ported to drupal 6.

llillf’s picture

Hi rooby,

Any advice of patching D6?

Thanks a lot!!!

llillf’s picture

Hi all,

Attached is a patch I made for Drupal 6. It works for me! Hope it can help anyone and be committed to D6 after more testing.

adammalone’s picture

Issue summary: View changes
Status: Patch (to be ported) » Needs work

Can we please get rid of the whitespace added in the patch?

mcdruid’s picture

Status: Needs work » Closed (outdated)

Thanks for the work that went into this, but closing D6 issues as outdated now.