• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to Read a Large size --XML File (80MB) PHP/ Codeigniter

#1
Hi ...Everyone...

I am having an issue seems tired and sinking perhaps you can rescue me, Though I am new with this tools PHP/ Codeigniterworking with a large XML file size about 80 MB. If you kindly help me with your code or instructionHow can I open and read this file using XML techniqes ( SAX or Parser )

Thanks you for your kind support in advance and highly waiting for you. Kindly forward in my  Address # fnbhns (A)(T) gmail (DOT)com #
Reply

#2
Not specific to CodeIgniter...
1) I use SimpleXML to read/manipulate XML documents
2) You are likely going to have to increase your memory limit in php.ini; an 80MB XML document will result in a much larger DOM in memory
Reply

#3
(09-20-2019, 01:28 PM)ciadmin Wrote: Not specific to CodeIgniter...
1) I use SimpleXML to read/manipulate XML documents
2) You are likely going to have to increase your memory limit in php.ini; an 80MB XML document will result in a much larger DOM in memory
Thank you so much for your so quickly reply. I am trying with the SimpleXML unfortunately I can not. However i never worked before with XML. If you kindly give me little support, I am trying to upload a XML file then Read the file, If i want i sent few record into SQL.  For your kind view I attached  the function i have written below.
Code:
public function importPro()
        {
           $fileName= $_FILES['xml_file']['name'];
            copy($_FILES['xml_file']['tmp_name'],'./assets/'.$fileName);
            $xmlfile= './assets/'.$fileName;
            $xmlRaw= file_get_contents($xmlfile);  
            $xmlData= $this->simplexml->xml_parse($xmlRaw);         
                      
            foreach($xmlData['product'] as $row)
            {
               // $this->mproduct->insert($row['code'],$row['name'] );
                $this->mproduct->insert($row['id'],$row['author'] );
            }
            $data['productList']= $this->mproduct->findAllProd();
            $this->load->view('product/success',$data);
           
        }

Your little advise could be a great help. Even if you like show your a piece of code how you used simpleXML which could be a great support too......! While i run this program its show below Error and few more line is there.

Code:
A PHP Error was encountered
Severity: Warning

Message: Illegal string offset 'toy'

Filename: libraries/simplexml.php(126) : eval()'d code

Line Number: 1
Sorry to give you trouble. in fact You can save me from a big trouble, otherwise i maybe fired . once again thanks for your kind support.
Reply

#4
A bit dated, but ... https://github.com/jedi-academy/example-...winter2016
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.