Index: branches/uploadwizard-deployment/includes/upload/UploadFromFile.php |
— | — | @@ -8,23 +8,24 @@ |
9 | 9 | * Implements regular file uploads |
10 | 10 | */ |
11 | 11 | class UploadFromFile extends UploadBase { |
| 12 | + protected $mUpload = null; |
12 | 13 | |
13 | | - |
14 | 14 | function initializeFromRequest( &$request ) { |
| 15 | + $upload = $request->getUpload( 'wpUploadFile' ); |
15 | 16 | $desiredDestName = $request->getText( 'wpDestFile' ); |
16 | 17 | if( !$desiredDestName ) |
17 | | - $desiredDestName = $request->getText( 'wpUploadFile' ); |
18 | | - return $this->initializePathInfo( |
19 | | - $desiredDestName, |
20 | | - $request->getFileTempName( 'wpUploadFile' ), |
21 | | - $request->getFileSize( 'wpUploadFile' ) |
22 | | - ); |
| 18 | + $desiredDestName = $upload->getName(); |
| 19 | + |
| 20 | + return $this->initialize( $desiredDestName, $upload ); |
23 | 21 | } |
| 22 | + |
24 | 23 | /** |
25 | | - * Entry point for upload from file. |
| 24 | + * Initialize from a filename and a WebRequestUpload |
26 | 25 | */ |
27 | | - function initialize( $name, $tempPath, $fileSize ) { |
28 | | - return $this->initializePathInfo( $name, $tempPath, $fileSize ); |
| 26 | + function initialize( $name, $webRequestUpload ) { |
| 27 | + $this->mUpload = $webRequestUpload; |
| 28 | + return $this->initializePathInfo( $name, |
| 29 | + $this->mUpload->getTempName(), $this->mUpload->getSize() ); |
29 | 30 | } |
30 | 31 | static function isValidRequest( $request ) { |
31 | 32 | return (bool)$request->getFileTempName( 'wpUploadFile' ); |
— | — | @@ -37,6 +38,4 @@ |
38 | 39 | public function getFileTempname() { |
39 | 40 | return $this->mUpload->getTempname(); |
40 | 41 | } |
41 | | - |
42 | | - |
43 | 42 | } |
Property changes on: branches/uploadwizard-deployment/includes/upload/UploadFromFile.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
44 | 43 | Merged /trunk/phase3/includes/upload/UploadFromFile.php:r70037,70049 |