Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function uploadFile(Request $ file){
- $data =Input::file('file');
- $informationdata = array('file' => $data);
- $rules = array(
- 'file' => 'required|mimes:xml|Max:10000000',
- );
- $validator= Validator::make($informationdata, $rules);
- if($validator->fails()){
- echo 'the file has not the correct extension';
- } else{
- XmlParser::load($data->getRealPath());
- }
- private function store($data){
- $destinationPath = public_path('uploads\');
- $fileName = $data->getClientOriginalName();
- $data->move($destinationPath,$fileName);
- $xml = simplexml_load_file($destinationPath.$fileName);
- }
- $xml = new SimpleXMLElement($destinationPath.$fileName, null, true);
- $xml = new DomDocument('1.0', 'utf-8'); // Or the right version and encoding of your xml file
- $xml->load($destinationPath.$fileName);
- $xml_object = simplexml_load_file($request->file('action')->getRealPath());
Add Comment
Please, Sign In to add comment