
###########
UploadCache
###########


****
NAME
****


Kernel::System::Web::UploadCache - an upload file system cache


***********
DESCRIPTION
***********


All upload cache functions.


****************
PUBLIC INTERFACE
****************


new()
=====


Don't use the constructor directly, use the ObjectManager instead:


.. code-block:: perl

     my $WebUploadCacheObject = $Kernel::OM->Get('Kernel::System::Web::UploadCache');



FormIDCreate()
==============


create a new Form ID


.. code-block:: perl

     my $FormID = $UploadCacheObject->FormIDCreate();



FormIDRemove()
==============


remove all data for a provided Form ID


.. code-block:: perl

     $UploadCacheObject->FormIDRemove( FormID => 123456 );



FormIDAddFile()
===============


add a file to a Form ID


.. code-block:: perl

     $UploadCacheObject->FormIDAddFile(
         FormID      => 12345,
         Filename    => 'somefile.html',
         Content     => $FileInString,
         ContentType => 'text/html',
         Disposition => 'inline', # optional
     );


ContentID is optional (automatically generated if not given on disposition = inline)


.. code-block:: perl

     $UploadCacheObject->FormIDAddFile(
         FormID      => 12345,
         Filename    => 'somefile.html',
         Content     => $FileInString,
         ContentID   => 'some_id@example.com',
         ContentType => 'text/html',
         Disposition => 'inline', # optional
     );



FormIDRemoveFile()
==================


removes a file from a form id


.. code-block:: perl

     $UploadCacheObject->FormIDRemoveFile(
         FormID => 12345,
         FileID => 1,
     );



FormIDGetAllFilesData()
=======================


returns an array with a hash ref of all files for a Form ID


.. code-block:: perl

     my @Data = $UploadCacheObject->FormIDGetAllFilesData(
         FormID => 12345,
     );
 
     Return data of on hash is Content, ContentType, ContentID, Filename, Filesize, FileID;



FormIDGetAllFilesMeta()
=======================


returns an array with a hash ref of all files for a Form ID

Note: returns no content, only meta data.


.. code-block:: perl

     my @Data = $UploadCacheObject->FormIDGetAllFilesMeta(
         FormID => 12345,
     );
 
     Return data of hash is ContentType, ContentID, Filename, Filesize, FileID;



FormIDCleanUp()
===============


Removed no longer needed temporary files.

Each file older than 1 day will be removed.


.. code-block:: perl

     $UploadCacheObject->FormIDCleanUp();





