[TYPO3-english] File uid in FAL file upload field hook
PIT Solutions
typo3 at pitsolutions.com
Wed Aug 20 10:04:40 CEST 2014
Hi Guys,
I got the answer !!!
We can iterate the result array like this way;
public function processData_postProcessAction($action, array $cmdArr, array $result, \TYPO3\CMS\Core\Utility\File\ExtendedFileUtility $parentObject){
$files = array_pop( $result );
if ( !is_array( $files ) ) {
return;
}
foreach ( $files as $file ) {
$fileUid .= $file->getUid(); // Uid of the file
$fileName .= $file->getName(); // Name of the file
}
}
Thanks & Regards,
Arun Chandran
Software Engineer
PIT Solutions Pvt Ltd.
________________________________
From: PIT Solutions <typo3 at pitsolutions.com>
To: TYPO3 English <typo3-english at lists.typo3.org>
Sent: Tuesday, August 19, 2014 7:01 PM
Subject: [TYPO3-english] File uid in FAL file upload field hook
Hi Guys,
I've extended ExtendedFileUtilityProcessDataHookInterface and created a hook for FAL file upload field.
class tx_bibusdocuments_fileUploadHook implements TYPO3\CMS\Core\Utility\File\ExtendedFileUtilityProcessDataHookInterface { public function processData_postProcessAction($action, array $cmdArr, array $result, \TYPO3\CMS\Core\Utility\File\ExtendedFileUtility $parentObject){}
} When I print the "$result" array, I got an array like this;
Array
( [0] => Array ( [0] => TYPO3\CMS\Core\Resource\File Object ( [metaDataLoaded:protected] => [metaDataProperties:protected] => Array ( ) [indexingInProgress:protected] => [updatedProperties:protected] => Array ( ) [indexerService:protected] => [properties:protected] => Array ( [size] => 198218 [modification_date] => 1408449118 [creation_date] => 1408449118 [mime_type] => application/pdf [name] => HomeTest.pdf [identifier] => /user_upload/test.pdf [identifier_hash] => 2bc8d0c4ed9f8a87fb9913af5dcd3977e0102027 [storage] => 1 [folder_hash] => e32a309fabc28dd85f053b65c5bd0da99860eb02 [type] => 5 [sha1] => 8a46595222d30c9cb4bcc48a4901d3e0f05e25ad [extension] => pdf [missing] => 0 [uid] => 139856 ) ) )
) How can I get uid of the file from this $result array?
Thanks in advance,Arun ChandranSoftware EngineerPIT Solutions Pvt Ltd.
_______________________________________________
TYPO3-english mailing list
TYPO3-english at lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-english
More information about the TYPO3-english
mailing list