I'm here with a problem uploading an XML file in PHP.
I have a form that allows me to select a file:
<form id="upload" action='' method='post' enctype="multipart/form-data" >
<input id='uploaded_file' type='file' name='uploaded_file' title="Procurar ficheiro" />
<input class="btn btn-primary" type="submit" name ="submitA_" value="Upload"/>
</form>
I have the code to read the file (through the DOM) and import the data into the DB:
$uploaded = (object) $_FILES['uploaded_file']; //line 42
$import->dom->load( $uploaded->tmp_name );
$import->updateDB();
What happens is when the file is relatively large (9MB), the object $uploaded->tmp_name
is empty and, as a consequence, upload is not done for the DB, in> warning of PHP:
Warning: DOMDocument :: load (): Empty string supplied as input on line 42
The $uploaded->error
is NULL
and the result of var_dump($uploaded);
is:
object (stdClass) # 2 (0) {}
Note: In% with% I have php.ini
and upload_max_filesize = 128M