swfupload_widget.inc
// Make sure that the thumbnails exist. $element['#value'] is
// structured differently in our widget, so this is not handled by
// imagefield_widget_process().
if (is_array($element['#value'])) {
foreach (element_children($element['#value']) as $key) {
if (isset($element['#value'][$key]['filepath'])) {
$file = $element['#value'][$key];
swfupload_thumb_path($file, TRUE);
}
}
}
There is no validation for image files.
It should be
if (isset($element['#value'][$key]['filepath']) && image_get_info($element['#value'][$key]['filepath'])) {
$file = $element['#value'][$key];
swfupload_thumb_path($file, TRUE);
}
On my site I have file_field for archives (max upload 100M). And swfupload_widget generates thumbnail for each of files uploaded.
1 file uploaded (100M) + thumb created (100M) = 200M
Comments
Comment #1
Nick Robillard commentedThis is a serious problem when dealing with large non-image files (some of mine are 300MB each). Thanks for the fix!