Monthly Archives: August 2011

Renaming file name in the file uploading process in ZF

The following code works for me to rename a file name in the uploading process in zend framework.

$fileTransferObject = new Zend_File_Transfer_Adapter_Http();
$uploadDir = 'your_upload_directory';


$renameFilter = new Zend_Filter_File_Rename( $uploadDir );
$files = $fileTransferObject->getFileInfo();
$time = microtime();
$timeArray = explode(‘ ‘ , $time);
$timeStr = $timeArray[1];
foreach($files as $fileID => $fileInfo)
$renameFilter->addFile( array(‘source’ => $fileInfo[‘tmp_name’], ‘target’ => $timeStr.’_’.$fileInfo[‘name’], ‘overwrite’ => true ) );
//check file recieved successful.
if (!$fileTransferObject->receive()) {
$messages = $fileTransferObject->getMessages();

Leave a comment

Posted by on August 8, 2011 in ZF


Tags: , ,

Easy way to find facebook page admin or user id

Facebook Like Box and some other plugins require admin id for meta information.

Suppose for like button plugin required admins id in the meta information:
So if you create your page by your facebook account then at first login to facebook. Find account tab from the top right navigation bar. Click on down arrow symbol besides account and then click on account settings. Then you will find

Username :
So your_id_name is your admin id or user id.

Leave a comment

Posted by on August 1, 2011 in Face Book