diff --git a/submodules/vsf_upload/includes/vsf_upload.admin.inc b/submodules/vsf_upload/includes/vsf_upload.admin.inc
new file mode 100644
index 0000000..2cda852
--- /dev/null
+++ b/submodules/vsf_upload/includes/vsf_upload.admin.inc
@@ -0,0 +1,76 @@
+<?php
+
+/**
+ * Page callback for admin/config/media/visual-select-file.
+ */
+function vsf_upload_settings_form($form, $form_state) {
+  $states = array();
+  if (module_exists('file_entity')) {
+    $form['vsf_file_entity'] = array(
+      '#type' => 'checkbox',
+      '#title' => t('Use file entity for uploads in the file browser'),
+      '#default_value' => variable_get('vsf_file_entity', TRUE),
+    );
+
+    $states = array(
+      '#states' => array(
+        'invisible' => array(':input[name="vsf_file_entity"]' => array('checked' => TRUE)),
+      )
+    );
+  }
+
+  $scheme_options = array();
+  foreach (file_get_stream_wrappers(STREAM_WRAPPERS_WRITE_VISIBLE) as $scheme => $stream_wrapper) {
+    $scheme_options[$scheme] = $stream_wrapper['name'];
+  }
+
+  if (count($scheme_options) > 1) {
+    $form['vsf_upload_scheme'] = array(
+      '#type' => 'radios',
+      '#title' => t('Upload destination'),
+      '#options' => $scheme_options,
+      '#default_value' => variable_get('vsf_upload_scheme', VSF_UPLOAD_SCHEME),
+      '#description' => t('Select where the final files should be stored. Private file storage has significantly more overhead than public files, but allows restricted access to files within this field.'),
+    ) + $states;
+  }
+  else {
+    $keys = array_keys($scheme_options);
+    $form['vsf_upload_scheme'] = array(
+      '#type' => 'value',
+      '#value' => current($keys),
+    );
+  }
+
+  form_load_include($form_state, 'inc', 'file', 'file.field');
+
+  $form['vsf_upload_location'] = array(
+    '#type' => 'textfield',
+    '#title' => t('File directory'),
+    '#default_value' => variable_get('vsf_upload_location', VSF_UPLOAD_LOCATION),
+    '#description' => t('Optional subdirectory within the upload destination where files will be stored. Do not include preceding or trailing slashes.'),
+    '#element_validate' => array('_file_generic_settings_file_directory_validate'),
+  ) + $states;
+
+  // Make the extension list a little more human-friendly by comma-separation.
+  $form['vsf_upload_extensions'] = array(
+    '#type' => 'textfield',
+    '#title' => t('Allowed file extensions'),
+    '#default_value' => variable_get('vsf_upload_extensions', VSF_UPLOAD_EXTENSIONS),
+    '#description' => t('Separate extensions with a space or comma and do not include the leading dot.'),
+    '#element_validate' => array('_file_generic_settings_extensions'),
+    '#required' => TRUE,
+  ) + $states;
+
+  $form['vsf_upload_size'] = array(
+    '#type' => 'textfield',
+    '#title' => t('Maximum upload size'),
+    '#default_value' => variable_get('vsf_upload_size', VSF_UPLOAD_FILE_SIZE),
+    '#description' => t('Enter a value like "512" (bytes), "80 KB" (kilobytes) or "50 MB" (megabytes) in order to restrict the allowed file size. If left empty the file sizes will be limited only by PHP\'s maximum post and file upload sizes (current limit <strong>%limit</strong>).', array('%limit' => format_size(file_upload_max_size()))),
+    '#size' => 10,
+    '#element_validate' => array('_file_generic_settings_max_filesize'),
+    '#required' => TRUE,
+  ) + $states;
+
+  return system_settings_form($form);
+}
+
diff --git a/submodules/vsf_upload/vsf_upload.info b/submodules/vsf_upload/vsf_upload.info
new file mode 100644
index 0000000..95cdeb9
--- /dev/null
+++ b/submodules/vsf_upload/vsf_upload.info
@@ -0,0 +1,8 @@
+name = Visual Select File WYSIWYG upload
+description = Adds upload support to Visual Select File WYSIWYG or a dedicated file upload form.
+core = 7.x
+
+package = User interface
+
+dependencies[] = file
+dependencies[] = visual_select_file
diff --git a/submodules/vsf_upload/vsf_upload.install b/submodules/vsf_upload/vsf_upload.install
new file mode 100644
index 0000000..bc6e31b
--- /dev/null
+++ b/submodules/vsf_upload/vsf_upload.install
@@ -0,0 +1,12 @@
+<?php
+
+/**
+ * Implements hook_uninstall().
+ */
+function vsf_upload_uninstall() {
+  variable_del('vsf_file_entity');
+  variable_del('vsf_upload_scheme');
+  variable_del('vsf_upload_location');
+  variable_del('vsf_upload_extensions');
+  variable_del('vsf_upload_size');
+}
diff --git a/submodules/vsf_upload/vsf_upload.module b/submodules/vsf_upload/vsf_upload.module
new file mode 100644
index 0000000..951f57a
--- /dev/null
+++ b/submodules/vsf_upload/vsf_upload.module
@@ -0,0 +1,197 @@
+<?php
+define('VSF_UPLOAD_EXTENSIONS', 'jpg jpeg gif png txt doc docx xls xlsx pdf ppt pptx pps ppsx odt ods odp mp3 mov mp4 m4a m4v mpeg avi ogg oga ogv weba webp webm');
+define('VSF_UPLOAD_FILE_SIZE', '2M');
+define('VSF_UPLOAD_LOCATION', 'visual_select_file');
+define('VSF_UPLOAD_SCHEME', 'public');
+
+/**
+ * Implements hook_init().
+ */
+function vsf_upload_init() {
+  if ('file/add' == $_GET['q'] && isset($_GET['vsf_destination'])) {
+    module_invoke('admin_menu', 'suppress');
+
+    $path = drupal_get_path('module', 'visual_select_file');
+    drupal_add_css($path . '/visual_select_file.modal.css');
+  }
+}
+
+/**
+ * Implements hook_preprocess_views_view().
+ */
+function vsf_upload_preprocess_views_view(&$vars) {
+  $view = $vars['view'];
+  if ($view->name == 'visual_select_file' && isset($_GET['ckeditor'])) {
+    if (module_exists('file_entity') && variable_get('vsf_file_entity', TRUE)) {
+      $link = l(t('Add file'), 'file/add', array('query' => array('vsf_destination' => request_uri())));
+      $vars['header'] = theme('item_list', array('items' => array($link), 'attributes' => array('class' => array('action-links'))));
+    }
+    else {
+      $form = drupal_get_form('vsf_upload_form');
+      $vars['header'] = drupal_render($form);
+    }
+  }
+}
+
+/**
+ * Upload form.
+ */
+function vsf_upload_form($form, &$form_state) {
+  $form['upload'] = array(
+    '#type' => 'fieldset',
+    '#title' => t('Upload a file'),
+    '#collapsed' => current_path() != 'file/add',
+    '#collapsible' => current_path() != 'file/add',
+    '#access' => user_access('upload vsf files'),
+  );
+  $form['upload']['file'] = array(
+    '#title' => t('File'),
+    '#type' => 'managed_file',
+    '#upload_location' => variable_get('vsf_upload_scheme', VSF_UPLOAD_SCHEME) . '://' . variable_get('vsf_upload_location', VSF_UPLOAD_LOCATION),
+    '#upload_validators' => array(
+      'file_validate_extensions' => array(variable_get('vsf_upload_extensions', VSF_UPLOAD_EXTENSIONS)),
+      'file_validate_size' => array(parse_size(variable_get('vsf_upload_size', VSF_UPLOAD_FILE_SIZE))),
+    ),
+    '#process' => array('vsf_upload_file_element_process'),
+    '#description' => t('The maximum file size is: %file_size, the allowed file extensions are: %file_extensions.', array(
+      '%file_extensions' => variable_get('vsf_upload_extensions', VSF_UPLOAD_EXTENSIONS),
+      '%file_size' => format_size(parse_size(variable_get('vsf_upload_size', VSF_UPLOAD_FILE_SIZE))),
+    )),
+  );
+  $form['upload']['submit'] = array(
+    '#type' => 'submit',
+    '#value' => t('Upload'),
+    '#submit' => array('vsf_upload_form_submit'),
+  );
+  return $form;
+}
+
+function vsf_upload_file_element_process($element, &$form_state, $form) {
+  $element = file_managed_file_process($element, $form_state, $form);
+  $element['upload_button']['#access'] = FALSE;
+  return $element;
+}
+
+/**
+ * Upload form submit callback.
+ */
+function vsf_upload_form_submit($form, &$form_state) {
+  $file = file_load($form_state['values']['file']);
+  $file->status = FILE_STATUS_PERMANENT;
+  file_save($file);
+  drupal_set_message(t('File uploaded succesfully'));
+
+  $form_state['redirect'] = array(
+    current_path(),
+    array(
+      'fragment' => 'modal',
+      'query' => drupal_get_query_parameters(),
+    ),
+  );
+}
+
+/**
+ * Implements hook_menu().
+ */
+function vsf_upload_menu() {
+  $items = array();
+  $items['admin/config/media/visual-select-file'] = array(
+    'title' => 'Visual select file upload settings',
+    'description' => 'Visual file select upload settings',
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('vsf_upload_settings_form'),
+    'file' => 'includes/vsf_upload.admin.inc',
+    'access arguments' => array('administer site configuration'),
+  );
+  if (!module_exists('file_entity')) {
+    $items['file/add'] = array(
+      'title' => 'Add file',
+      'description' => 'Upload a file',
+      'page callback' => 'drupal_get_form',
+      'page arguments' => array('vsf_upload_form'),
+      'access arguments' => array('upload vsf files'),
+      'type' => MENU_NORMAL_ITEM,
+      'menu_name' => 'navigation',
+    );
+  }
+
+  return $items;
+}
+
+/**
+ * Implements hook_admin_menu_output_build().
+ *
+ * @see amin_menu_admin_menu_output_build().
+ */
+function vsf_upload_admin_menu_output_build(&$content) {
+  // Retrieve the "Add file" link tree.
+  $link = db_query("SELECT * FROM {menu_links} WHERE router_path = 'file/add' AND module = 'system'")->fetchAssoc();
+  if ($link) {
+    $conditions = array();
+    for ($i = 1; $i < MENU_MAX_DEPTH; $i++) {
+      if (!empty($link["p$i"])) {
+        $conditions["p$i"] = $link["p$i"];
+      }
+    }
+    $tree = menu_build_tree($link['menu_name'], array(
+      'conditions' => $conditions,
+      'min_depth' => $link['depth'],
+    ));
+    $links = admin_menu_links_menu($tree);
+    if (!empty($links)) {
+      // If the user has access to the top-level "Content" category, insert the
+      // "Add file" link tree there.
+      if (isset($content['menu']['admin/content'])) {
+        $content['menu']['admin/content'] += $links;
+      }
+      // Otherwise make insert "Add file" as top-level category.
+      else {
+        $key = key($links);
+        $links[$key]['#weight'] = -100;
+        $content['menu'] += $links;
+      }
+    }
+  }
+}
+
+/**
+ * Implements hook_admin_paths().
+ */
+function vsf_upload_admin_paths() {
+  $paths = array(
+    'file/add' => TRUE,
+  );
+  return $paths;
+}
+
+/**
+ * Implements hook_permission().
+ */
+function vsf_upload_permission() {
+  return array(
+    'upload vsf files' => array(
+      'title' => t('Upload files'),
+      'description' => t('Allows the user to upload files via the vsf upload page.'),
+    ),
+  );
+}
+
+/**
+ * Implements hook_form_FORM_ID_alter for file_entity_add_upload().
+ */
+function vsf_upload_form_file_entity_add_upload_alter(&$form, $form_state) {
+  $form['#submit'][] = 'vsf_upload_form_file_entity_add_upload_submit';
+}
+
+/**
+ * Submit handler for file_entity_add_upload().
+ */
+function vsf_upload_form_file_entity_add_upload_submit($form, &$form_state) {
+  $url = parse_url($_GET['vsf_destination']);
+  $query = array();
+  isset($url['query']) && parse_str($url['query'], $query);
+
+  if (isset($url['path'])) {
+    $form_state['redirect'] = array($url['path'], array('query' => $query, 'fragment' => 'modal'));
+  }
+}
diff --git a/visual_select_file.js b/visual_select_file.js
index 5d145f3..3b45f25 100644
--- a/visual_select_file.js
+++ b/visual_select_file.js
@@ -83,7 +83,7 @@
     options = Drupal.visualSelectFile.dialogOptions(options, context);
 
     // Create modal.
-    var $modal = $('<div><iframe width="100%" height="100%" src="' + path + '"></iframe></div>');
+    var $modal = $('<div><iframe width="99%" height="99%" src="' + path + '"></iframe></div>');
     $('body').append($modal);
     $modal.dialog(options);
 
@@ -128,15 +128,18 @@
 
   // After clicking an image in the Views grid.
   Drupal.visualSelectFile.onEmbed = function($td, editor, owner) {
+    var file = Drupal.visualSelectFile.extractTDMetaInfo($td);
+    if (!file) {
+      return;
+    }
+
     var format = $td.closest('.view').find('#edit-vsf-formatter').val();
     if (!format) {
       $td.closest('.view').find('.form-item-vsf-formatter').addClass('error').find('select').addClass('error');
       return;
     }
 
-    var
-      file = Drupal.visualSelectFile.extractTDMetaInfo($td),
-      img = Drupal.visualSelectFile.ckeditorEmbeddable(file, format, editor, owner);
+    var img = Drupal.visualSelectFile.ckeditorEmbeddable(file, format, editor, owner);
     if (!img) {
       return;
     }
diff --git a/visual_select_file.modal.css b/visual_select_file.modal.css
index 75fc9ea..d12cac5 100644
--- a/visual_select_file.modal.css
+++ b/visual_select_file.modal.css
@@ -48,3 +48,21 @@ html .form-item-vsf-formatter {
   word-break: break-all;
   word-wrap: break-word;
 }
+
+html .views-exposed-form .views-exposed-widgets *, html .view-header .fieldset-wrapper > *, html .view-header .fieldset-wrapper .form-type-managed-file > * {
+  display: inline-block;
+  margin: 0;
+}
+
+html .views-exposed-form .views-exposed-widget .form-submit {
+  margin-top: 0;
+}
+
+html .views-exposed-form .views-exposed-widget {
+  float: none;
+  padding: 0;
+}
+
+html .item-list ul.action-links li {
+  list-style-type: none;
+}
