diff --git a/core/modules/editor/editor.module b/core/modules/editor/editor.module
index af2b8ea..56e0421 100644
--- a/core/modules/editor/editor.module
+++ b/core/modules/editor/editor.module
@@ -223,6 +223,91 @@ function editor_form_filter_format_form_alter(&$form, &$form_state) {
     $form['editor']['editor']['#disabled'] = TRUE;
     $form['editor']['editor']['#description'] = t('This option is disabled because no modules that provide a text editor are currently enabled.');
   }
+  
+  $form['editor']['upload'] = array(
+    '#tree' => TRUE,
+    '#weight' => -9,
+    '#type' => 'container',
+    '#id' => 'editor-upload-wrapper',
+  );  
+  
+  $form['editor']['upload']['upload_directory'] = array(
+      '#type' => 'textfield',
+      '#default_value' => isset($editor->upload['upload_directory']) ? $editor->upload['upload_directory'] : '',
+      '#title' => t('Upload directory'),
+      '#description' => t('A directory relative to Drupal\'s files directory where upload images will be stored.'),
+  );
+  
+  $form['editor']['upload']['upload_file_size'] = array(
+      '#type' => 'textfield',
+      '#default_value' => isset($editor->upload['upload_file_size']) ? $editor->upload['upload_file_size'] : '',
+      '#title' => t('Maximum image size'),
+      '#description' => t('If this is left empty, then the file size will be limited by the PHP maximum upload size of ' . format_size(file_upload_max_size())),
+  );  
+  
+  $form['editor']['upload']['upload_max_dimensions'] = array(
+      '#type' => 'item',
+      '#title' => t('Maximum image dimensions'),
+      '#field_prefix' => '<div class="container-inline clearfix">',
+      '#field_suffix' => '</div>',
+      '#description' => t('Images larger than these dimensions will be scaled down.'),
+  );
+  $form['editor']['upload']['upload_max_dimensions']['max_width'] = array(
+    '#title' => t('Width'),
+    '#title_display' => 'invisible',
+    '#type' => 'number',
+    '#default_value' => isset($editor->upload['upload_max_dimensions']['max_width']) ? $editor->upload['upload_max_dimensions']['max_width'] : '',
+    '#size' => 8,
+    '#maxlength' => 8,
+    '#min' => 1,
+    '#max' => 99999,
+    '#placeholder' => 'width',
+    '#field_suffix' => ' x ',
+  );
+  $form['editor']['upload']['upload_max_dimensions']['max_height'] = array(
+    '#title' => t('Height'),
+    '#title_display' => 'invisible',
+    '#type' => 'number',
+    '#default_value' => isset($editor->upload['upload_max_dimensions']['max_height']) ? $editor->upload['upload_max_dimensions']['max_height'] : '',
+    '#size' => 8,
+    '#maxlength' => 8,
+    '#min' => 1,
+    '#max' => 99999,
+    '#placeholder' => 'height',
+    '#field_suffix' => 'pixels',
+  );  
+
+  $form['editor']['upload']['upload_min_dimensions'] = array(
+    '#type' => 'item',
+    '#title' => t('Minimum image dimensions'),
+    '#field_prefix' => '<div class="container-inline clearfix">',
+    '#field_suffix' => '</div>',
+    '#description' => t('Images smaller than these dimensions will not be uploaded.'),
+  );
+  $form['editor']['upload']['upload_min_dimensions']['min_width'] = array(
+    '#title' => t('Width'),
+    '#title_display' => 'invisible',
+    '#type' => 'number',
+    '#default_value' => isset($editor->upload['upload_min_dimensions']['min_width']) ? $editor->upload['upload_min_dimensions']['min_width'] : '',
+    '#size' => 8,
+    '#maxlength' => 8,
+    '#min' => 1,
+    '#max' => 99999,
+    '#placeholder' => 'width',
+    '#field_suffix' => ' x ',
+  );
+  $form['editor']['upload']['upload_min_dimensions']['min_height'] = array(
+    '#title' => t('Height'),
+    '#title_display' => 'invisible',
+    '#type' => 'number',
+    '#default_value' => isset($editor->upload['upload_min_dimensions']['min_height']) ? $editor->upload['upload_min_dimensions']['min_height'] : '',
+    '#size' => 8,
+    '#maxlength' => 8,
+    '#min' => 1,
+    '#max' => 99999,
+    '#placeholder' => 'height',
+    '#field_suffix' => 'pixels',
+  );   
 
   $form['editor']['settings'] = array(
     '#tree' => TRUE,
@@ -312,6 +397,7 @@ function editor_form_filter_admin_format_submit($form, &$form_state) {
     // would equal the empty string.
     $form_state['editor']->format = $format_id;
     $form_state['editor']->settings = $form_state['values']['editor']['settings'];
+    $form_state['editor']->upload = $form_state['values']['editor']['upload'];
     $form_state['editor']->save();
   }
 }
diff --git a/core/modules/editor/lib/Drupal/editor/Form/EditorImageDialog.php b/core/modules/editor/lib/Drupal/editor/Form/EditorImageDialog.php
index 0fa6249..715a772 100644
--- a/core/modules/editor/lib/Drupal/editor/Form/EditorImageDialog.php
+++ b/core/modules/editor/lib/Drupal/editor/Form/EditorImageDialog.php
@@ -13,6 +13,8 @@
 use Drupal\Core\Ajax\HtmlCommand;
 use Drupal\editor\Ajax\EditorDialogSave;
 use Drupal\Core\Ajax\CloseModalDialogCommand;
+use Drupal\Core\StreamWrapper\LocalStream;
+use Drupal\file\FileInterface;
 
 /**
  * Provides an image dialog for text editors.
@@ -41,16 +43,36 @@ class EditorImageDialog implements FormInterface {
     $form['#attached']['library'][] = array('editor', 'drupal.editor.dialog');
     $form['#prefix'] = '<div id="editor-image-dialog-form">';
     $form['#suffix'] = '</div>';
-
-    // Everything under the "attributes" key is merged directly into the
-    // generated img tag's attributes.
-    $form['attributes']['src'] = array(
-      '#title' => t('URL'),
-      '#type' => 'textfield',
-      '#default_value' => isset($input['src']) ? $input['src'] : '',
-      '#maxlength' => 2048,
+    
+    $editor = editor_load($filter_format->format);
+    
+    // Construct strings to use in the 
+    // file_validate_image_resolution validator  
+    if (!empty($editor->upload['upload_max_dimensions'])) {
+      $max_dimensions = $editor->upload['upload_max_dimensions']['max_width'] . 'x' . $editor->upload['upload_max_dimensions']['max_height'];
+    } else {
+      $max_dimensions = 0;
+    }   
+    if (!empty($editor->upload['upload_min_dimensions'])) {
+      $min_dimensions = $editor->upload['upload_min_dimensions']['min_width'] . 'x' . $editor->upload['upload_min_dimensions']['min_height'];
+    } else {
+      $min_dimensions = 0;
+    }     
+    $max_filesize = min(parse_size($editor->upload['upload_file_size']), file_upload_max_size());
+    
+    $form['fid'] = array(
+      '#title' => t('Image'),
+      '#type' => 'managed_file',
+      '#description' => t('The uploaded image will be displayed on this page.'),
+      '#upload_location' => file_build_uri($editor->upload['upload_directory']),
+      '#default_value' => isset($input['fid']) ? $input['fid'] : '',
+      '#upload_validators' => array(
+        'file_validate_extensions' => array('gif png jpg jpeg'),
+        'file_validate_size' => array($max_filesize),
+        'file_validate_image_resolution' => array($max_dimensions, $min_dimensions),
+      ),
       '#required' => TRUE,
-    );
+    );    
 
     $form['attributes']['alt'] = array(
       '#title' => t('Alternative text'),
@@ -120,6 +142,13 @@ class EditorImageDialog implements FormInterface {
   public function submitForm(array &$form, array &$form_state) {
     $response = new AjaxResponse();
 
+    $file = file_load($form_state['values']['fid'][0]);
+    $file->status = FILE_STATUS_PERMANENT;
+    $uri = $file->getFileUri();
+    $stream = file_stream_wrapper_get_instance_by_uri($uri);
+    $form_state['values']['attributes']['src'] = str_replace($_SERVER['DOCUMENT_ROOT'], '', $stream->realpath());      
+    $file->save(); 
+
     if (form_get_errors()) {
       unset($form['#prefix'], $form['#suffix']);
       $output = drupal_render($form);
diff --git a/core/modules/editor/lib/Drupal/editor/Plugin/Core/Entity/Editor.php b/core/modules/editor/lib/Drupal/editor/Plugin/Core/Entity/Editor.php
index 710b991..790bddb 100644
--- a/core/modules/editor/lib/Drupal/editor/Plugin/Core/Entity/Editor.php
+++ b/core/modules/editor/lib/Drupal/editor/Plugin/Core/Entity/Editor.php
@@ -52,6 +52,13 @@ class Editor extends ConfigEntityBase implements EditorInterface {
    * @var array
    */
   public $settings = array();
+  
+  /**
+   * The array of settings for the file upload.
+   *
+   * @var array
+   */
+  public $upload = array();
 
   /**
    * Overrides Drupal\Core\Entity\Entity::id().
