• PHP Video Tutorials

PHP FDF Get Attachment Module



The fdf_get_attachment() function can extract uploaded file embedded in the FDF.

Syntax

array fdf_get_attachment( resource $fdf_document , string $fieldname , string $savepath )

The fdf_get_attachment() function can extract a file uploaded by means of the "file selection" field fieldname and store it under savepath.

The fdf_get_attachment() function can return an array contains the following fields−

  • path − path were the file got stored

  • size − size of the stored file in bytes

  • type − mimetype if given in the FDF

Example

<?php
   $fdf = fdf_open_string($HTTP_FDF_DATA);
   $data = fdf_get_attachment($fdf, "filename", "/tmpdir");
   echo "The uploaded file is stored in $data[path]";
?>  
php_function_reference.htm
Advertisements