From 44ce2aac835050ee8ce7ee403ff0e214ad2d8221 Mon Sep 17 00:00:00 2001 From: Mark Jaquith Date: Wed, 23 May 2007 19:36:35 +0000 Subject: [PATCH] Allow MT Importer to use FTP-uploaded file (to get around php.ini-set file upload size limit). fixes #4284 git-svn-id: https://develop.svn.wordpress.org/trunk@5531 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/import/mt.php | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/wp-admin/import/mt.php b/wp-admin/import/mt.php index 3aa1a50b64..731fe48180 100644 --- a/wp-admin/import/mt.php +++ b/wp-admin/import/mt.php @@ -22,9 +22,18 @@ class MT_Import { $this->header(); ?>
-

+

mt-export.txt in your /wp-content/ directory and then click "Import mt-export.txt"'); ?>

-

out of memory error try splitting up the import file into pieces.'); ?>

+
+ +

+ +mt-export.txt in your /wp-content/ directory'); ?>

+

+ +

+
+

out of memory error try splitting up the import file into pieces.'); ?>

footer(); @@ -138,7 +147,7 @@ class MT_Import { ?>

-

admins entries.'); ?>

+

italics. For each of these names, you can either pick an author in your WordPress installation from the menu, or enter a name for the author in the textbox.'); ?>

mt-export.txt does not exist'); + else + $file['file'] = ABSPATH . '/wp-content/mt-export.txt'; + } else { + $file = wp_import_handle_upload(); + } if ( isset($file['error']) ) { $this->header(); echo '

'.__('Sorry, there has been an error').'.

'; @@ -400,8 +417,10 @@ class MT_Import { function import() { $this->id = (int) $_GET['id']; - - $this->file = get_attached_file($this->id); + if ( $this->id == 0 ) + $this->file = ABSPATH . '/wp-content/mt-export.txt'; + else + $this->file = get_attached_file($this->id); $this->get_authors_from_post(); $this->get_entries(); $this->process_posts();