Back
imageUploadFunction
Editing, Updating and Creating Records
imageUploadFunction
Name of function to call when uploading data in PHP safe mode
Default:
In PHP safe mode, you cannot access files outside the Web server root directory. In this case phplens cannot read uploaded files with some help from you.

You need to define a function which accepts one parameter, the PHP4 upload array and returns as a binary string the contents of the file to be uploaded. Set the name of this function to the imageUploadFunction property.

This array is equivalent to $HTTP_POST_FILES['tmpfile'].

function uploadimg($arr)
{
$fp = fopen($arr['tmp_name'],'r');
if (!$fp) return false;
$s = fread($fp,9999999);
fclose ($fp);
return $s;
}


$arr should contain:

$arr['name']
The original name of the file on the client machine.

$arr[type']
The mime type of the file, if the browser provided this information. An example would be "image/gif".

$arr['size']
The size, in bytes, of the uploaded file.

$arr['tmp_name']
The name of the uploaded file.

See http://php.net/manual/en/features.file-upload.php

Syntax
$lens = PHPLensConnect(...); $lens->imageUploadFunction = 'uploadimg'; $lens->Render();

 Basic:Yes  Advanced/Enterprise:Yes  DynamicEdit:Yes   [Version 1.0]