diff --git a/antivirus.admin.inc b/antivirus.admin.inc
index 605341c..a7715a0 100644
--- a/antivirus.admin.inc
+++ b/antivirus.admin.inc
@@ -67,6 +67,18 @@ function antivirus_admin_form() {
     '#default_value' => variable_get('antivirus_notify_msg', ''),
   );
 
+  $form['behavior']['antivirus_empty_file_behavior'] = array(
+    '#title' => t('Empty file behavior'),
+    '#type' => 'radios',
+    '#options' => array(
+      ANTIVIRUS_EMPTY_FILE_SCAN => t('Scan file anyway'),
+      ANTIVIRUS_EMPTY_FILE_SKIP => t('Skip the file scan'),
+    ),
+    '#required' => TRUE,
+    '#description' => t('In some cases a Drupal file object may contain a reference to an externally hosted file. In other cases a local file may indeed be empty. You may choose how to handle these cases.'),
+    '#default_value' => variable_get('antivirus_empty_file_behavior', ANTIVIRUS_EMPTY_FILE_SCAN),
+  );
+
   $form['development'] = array(
     '#title' => t('Development'),
     '#type' => 'fieldset',
diff --git a/antivirus.module b/antivirus.module
index c0d6ddf..74b3005 100644
--- a/antivirus.module
+++ b/antivirus.module
@@ -31,6 +31,16 @@ define('ANTIVIRUS_NOTIFY_NONE', 0x10);
 define('ANTIVIRUS_NOTIFY_ADMIN', 0x11);
 
 /**
+ * Denotes that an empty file should be scanned.
+ */
+define('ANTIVIRUS_EMPTY_FILE_SCAN', 0x12);
+
+/**
+ * Denotes that an empty file should be skipped.
+ */
+define('ANTIVIRUS_EMPTY_FILE_SKIP', 0x13);
+
+/**
  * Denotes that a failed scan should result in an error, preventing the upload.
  */
 define('ANTIVIRUS_FAIL_ERROR', 0x20);
@@ -155,6 +165,17 @@ function antivirus_theme() {
  * Implements hook_file_validate().
  */
 function antivirus_file_validate($file) {
+  clearstatcache(TRUE, $file->uri);
+  $filesize = filesize($file->uri);
+  $skip = variable_get('antivirus_empty_file_behavior', ANTIVIRUS_EMPTY_FILE_SCAN);
+
+  // Skip the antivirus scan of empty or non-existent files if the user has
+  // configured the module to do so.
+  if ($skip == ANTIVIRUS_EMPTY_FILE_SKIP && empty($filesize)) {
+    watchdog('antivirus', 'Skipping the antivirus scan of file "%file" (fid:%fid - %size bytes) which appears to be empty.', array('%file' => $file->uri, '%fid' => $file->fid, '%size' => $filesize), WATCHDOG_WARNING);
+    return;
+  }
+
   $scan = antivirus_scan()
     ->addTargets(array($file))
     ->scan();
