Public Member Functions | |
load () |
Definition at line 35 of file Http.php.
load | ( | ) |
Implements Mage_Dataflow_Model_Convert_Adapter_Interface.
Definition at line 37 of file Http.php.
00038 { 00039 if (!$_FILES) { 00040 ?> 00041 <form method="POST" enctype="multipart/form-data"> 00042 File to upload: <input type="file" name="io_file"/> <input type="submit" value="Upload"/> 00043 </form> 00044 <?php 00045 exit; 00046 } 00047 if (!empty($_FILES['io_file']['tmp_name'])) { 00048 //$this->setData(file_get_contents($_FILES['io_file']['tmp_name'])); 00049 $uploader = new Varien_File_Uploader('io_file'); 00050 $uploader->setAllowedExtensions(array('csv','xml')); 00051 $path = Mage::app()->getConfig()->getTempVarDir().'/import/'; 00052 $uploader->save($path); 00053 if ($uploadFile = $uploader->getUploadedFileName()) { 00054 $fp = fopen($uploadFile, 'rb'); 00055 while ($row = fgetcsv($fp)) { 00056 00057 } 00058 fclose($fp); 00059 } 00060 } 00061 return $this; 00062 }