Forums / Developer / Get information on posted file data

"Please Note:
  • At the specific request of Ibexa we are changing this projects name to "Exponential" or "Exponential (CMS)" effective as of August, 11th 2025.
  • This project is not associated with the original eZ Publish software or its original developer, eZ Systems or Ibexa".

Get information on posted file data

Author Message

Nathalie Grimaud

Wednesday 07 December 2005 6:39:29 am

Hi,
In a template I have a simple form with an <input type="file" name="myfile"> field inside.
In the target template I easily get the value of this field using ezhttp('myfile') but how can I get other information like using $_FILES['myfile']['tmp_name'] in php ?

Thanks for your help
Nathalie

Clemens T

Wednesday 07 December 2005 8:35:48 am

Ok, you need to dive into the kernel to get the answer, here are some pointers:

...
	include_once( 'kernel/classes/ezcontentupload.php' );

    	if ( $http->hasPostVariable( 'UploadLocationChoice' ) )
    	{
		$node_to_upload_to = $http->postVariable('UploadLocationChoice');
	} else {
		$node_to_upload_to = 207;
	}
	$upload = new eZContentUpload( array() );
	$upload->handleUpload( $result, 'UploadFile', $node_to_upload_to, false );
...

this is code I copied from some old module of mine.. hopefully you can get some info on it. For more detail, checkout the eZContentUpload::handleUpload function( ..'kernel/classes/ezcontentupload.php' is where you can find it).

Greets,
Clemens