diff --git a/modules/simplytest_import/simplytest_import.module b/modules/simplytest_import/simplytest_import.module
index 5426d27..88817df 100644
--- a/modules/simplytest_import/simplytest_import.module
+++ b/modules/simplytest_import/simplytest_import.module
@@ -1,5 +1,4 @@
 <?php
-
 /**
  * @file
  * Imports project data from XML.
@@ -10,6 +9,7 @@
  */
 function simplytest_import_menu() {
   $items = array();
+
   $items['admin/simplytest/import'] = array(
     'title' => 'Import',
     'description' => 'Import project data',
@@ -17,6 +17,7 @@ function simplytest_import_menu() {
     'page arguments' => array('simplytest_import_form'),
     'access arguments' => array('administer simplytest'),
   );
+
   return $items;
 }
 
@@ -24,19 +25,55 @@ function simplytest_import_menu() {
  * Form builder function for the import batch.
  */
 function simplytest_import_form($form) {
-  $form['pathname'] = array(
+  $defaults = variable_get('simplytest_import', array(
+    'method' => 'path',
+    'path' => '',
+    'count' => 100,
+  ));
+
+  $form['method'] = array(
+    '#type' => 'radios',
+    '#title' => t('Method'),
+    '#options' => array(
+      'path' => t('Path to file'),
+      'upload' => t('Upload'),
+      'download' => t('Automatic download <em>(expirimental)</em>'),
+    ),
+    '#default_value' => $defaults['method'],
+  );
+
+  $form['path'] = array(
     '#type' => 'textfield',
     '#title' => t('Path to the file to import project data from'),
+    '#default_value' => $defaults['path'],
+    '#states' => array(
+      'visible' => array(
+        ':input[name="method"]' => array('value' => 'path'),
+      ),
+    ),
   );
+
+  $form['upload'] = array(
+    '#type' => 'file',
+    '#title' => t('Upload'),
+    '#states' => array(
+      'visible' => array(
+        ':input[name="method"]' => array('value' => 'upload'),
+      ),
+    ),
+  );
+
   $form['count'] = array(
     '#type' => 'textfield',
     '#title' => t('Count of projects to import per operation'),
-    '#default_value' => 100,
+    '#default_value' => $defaults['count'],
   );
+
   $form['submit'] = array(
     '#type' => 'submit',
     '#value' => t('Start'),
   );
+
   return $form;
 }
 
@@ -44,9 +81,10 @@ function simplytest_import_form($form) {
  * Validation handler for building the batch.
  */
 function simplytest_import_form_validate($form, &$form_state) {
-  if (!file_exists($form_state['values']['pathname'])) {
-    form_set_error('pathname', t('File not found'));
+  if ($form_state['values']['method'] == 'path' && !file_exists($form_state['values']['path'])) {
+    form_set_error('path', t('File not found'));
   }
+
   if ((int) $form_state['values']['count'] < 1) {
     form_set_error('count', t('Count must be integer > 0'));
   }
@@ -56,46 +94,87 @@ function simplytest_import_form_validate($form, &$form_state) {
  * Submit handler for building the batch.
  */
 function simplytest_import_form_submit($form, &$form_state) {
-  // Load the XML file.
-  $xml = simplexml_load_file($form_state['values']['pathname']);
-  $projects = count($xml->project);
-  $count = (int) $form_state['values']['count'];
+  // Make sure table is empty.
+  db_truncate('simplytest_projects')->execute();
 
-  $ops = array();
+  $operations = array();
 
-  // Create operations with the specified count of imports.
-  for ($index = 0; $index < $projects; $index += $count) {
-    if (!isset($xml->project[$index])) {
+  switch ($form_state['values']['method']) {
+    case 'upload':
+      $validators = array('file_validate_extensions' => array('xml'));
+      $file = file_save_upload('upload', $validators);
+      $file = $file->uri;
+      break;
+
+    case 'download':
+      $file = 'temporary://projects-' . REQUEST_TIME . '.xml';
+      $operations[] = array('simplytest_import_batch_operation_download_xml', array($file));
       break;
-    }
-    $ops[] = array(
-      'simplytest_import_batch_operation',
-      array(range($index, $index + $count - 1), $form_state['values']['pathname']),
-    );
   }
 
-  // Make sure table is empty.
-  db_truncate('simplytest_projects')->execute();
+  // Create and set Batch.
+  $operations[] = array('simplytest_import_batch_operation_process_xml', array($file));
+  $batch = array(
+    'operations' => $operations,
+  );
+  batch_set($batch);
 
-  watchdog('simplytest_import', 'Started to import XML project file: %file', array('%file' => $form_state['values']['pathname']), WATCHDOG_NOTICE);
+  watchdog('simplytest_import', 'Started to import XML project file: %file', array('%file' => $file), WATCHDOG_NOTICE);
 
-  batch_set(array(
-    'operations' => $ops,
-  ));
+  // Exclude unnecessary elements.
+  form_state_values_clean($form_state);
+
+  // Store last chosen values as defaults.
+  variable_set('simplytest_import', $form_state['values']);
 }
 
 /**
- * Batch operation.
+ * Batch operation; Download the XML file.
  */
-function simplytest_import_batch_operation($ids, $file, &$context) {
+function simplytest_import_batch_operation_download_xml($file, &$context) {
+  set_time_limit(0);
+
+  $fp = fopen($file, 'w+');
+  $ch = curl_init('http://updates.drupal.org/release-history/project-list/all');
+
+  curl_setopt($ch, CURLOPT_TIMEOUT, 90);
+  curl_setopt($ch, CURLOPT_FILE, $fp);
+  curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
+
+  curl_exec($ch);
+  curl_close($ch);
+  fclose($fp);
+}
+
+/**
+ * Batch operation; Process the XML file.
+ */
+function simplytest_import_batch_operation_process_xml($file, &$context) {
   $xml = simplexml_load_file($file);
 
-  // Iterate through projects of this round.
-  foreach ($ids as $id) {
-    if (!isset($xml->project[$id])) {
-      break;
+  if (!isset($context['sandbox']['index'])) {
+    $defaults = variable_get('simplytest_import', array('count' => 100));
+
+    $context['sandbox']['max'] = count($xml->project);
+    $context['sandbox']['count'] = $defaults['count'];
+    $context['sandbox']['index'] = 0;
+  }
+
+  $count = 0;
+  while ($context['sandbox']['index'] < $context['sandbox']['max'] && $count < $context['sandbox']['count']) {
+    if (isset($xml->project[$context['sandbox']['index']])) {
+      simplytest_projects_xml_insert_project($xml->project[$context['sandbox']['index']]);
     }
-    // Add each project's initial data.
-    simplytest_projects_xml_insert_project($xml->project[$id]);
+
+    $context['sandbox']['index']++;
+    $count++;
+  }
+
+  $context['message'] = t('Projects indexed: @index of @max.', array(
+    '@index' => $context['sandbox']['index'],
+    '@max' => $context['sandbox']['max'],
+  ));
+  if ($context['sandbox']['index'] != $context['sandbox']['max']) {
+    $context['finished'] = $context['sandbox']['index'] / $context['sandbox']['max'];
   }
 }
