[TYPO3-dev] Accessing legacy or temporary folders with FAL in backend modules

Dan Untenzu mail at pixelbrackets.de
Fri Nov 15 13:17:35 CET 2013


Hi,

what is the preferred way to access legacy or temporary folders with FAL in backend modules?

I am asking because of the following troubles:
The extension direct_mail has a module which allows to import CSV files into recipient lists. In ticket #44725 (forge.typo3.org/issues/44725) the module was patched to work with the FAL. The fix creates a file identifier for the temporary folder which uses the legacy storage »0« (look like this: »0:uploads/tx_directmail/«). 

This fix is not working anymore, an exception is thown ("You are not allowed to access files outside your storages", wiki.typo3.org/Exception/CMS/1375889830). This bug is discussed in ticket #52077 (forge.typo3.org/issues/52077). 

The reason for this is commit:cbed687fbb6dd16ea5363bc97efed970d552f88f (review.typo3.org/#/c/23608/) which prevents backend modules from accessing the legacy storage 0 due to security reasons. Folders like »uploads/« or »typo3temp/« are not accessible because of that.

A solution is to use a valid folder in an existing storage, such as »fileadmin/_temp_/« (fileadmin is the default storage and therefore accessible). But is this best practice? Is there any other way to use temporary folders with FAL in backend modules?

I encountered another strange behaviour incidentally: If I put a file into a valid storage and use the method »getForLocalProcessing« (api.typo3.org/typo3cms/60/html/class_t_y_p_o3_1_1_c_m_s_1_1_core_1_1_resource_1_1_file_reference.html#a85305d2e879d9de2318cdf2c7450b9d3) to open the uploaded file with some system tool the FAL will return a path to »typo3temp« which is _again_ not accessible. Thats why I am even more curious about this procedure.



More information about the TYPO3-dev mailing list