Files management & accessesThis article only concerns dynamic files (images, medias, ...) Contents files are the files indexed by database rows.
File fieldMimes & extensionsThe mime type is contained in the header file. If a user change the extension, still the application recognize the file's original type. Know issue : Mime detection is not working on your server: Cook is trying various ways to read the mime type, but still it is possible that none of the proposed methods works. Field propertiesYou can add or remove files types.
Protected filesUsing indirect mode, the full path is never revealed, so the user cannot know where the physical file is stored.
How it works ?Instead of calling the image with its file name, it call the component engine : index.php?option=com_mycomponent&task=file...&path=[DIR_MYALIASDIRECTORY]/myimage.png Then the component analyse the query and return the file bit per bit with corresponding headers.
Directory aliasesYour component has registered a list of directory aliases, wich contain the full base paths. Per default, the directory alias are constructed following this rule : [DIR_TRIAD_FIELD] TRIAD is the table alias (plural alias) Very important : This documentation expose the default name convention. Open the component configuration Then choose a directory path. You can use predefined aliases : [ROOT] : Joomla root Aliased path$path is an aliased string: Alias directory + file relative directory + file name + extension Example: [DIR_FILES_IMAGE]/2014-03/myimage.png Note : The relative directory can be created with the 'renaming' rules of your file at upload. (see uploader)
Building the urlCook offer you the possibility to build the image link automatically from a static helper call.
|
|
Freakin' Awesome!!! J-Cook is simply awesome - whether you're a highly experienced developer or complete novice whether you're building a small inventory component or a complete community solution! The beauty comes from a fast slick and reliable platform that readily provides developers with everything they'll need to build the backbone of a solid and secure component with wizards for authoring access publishing aliasing created/modified by dates... you name it COOK provides it! J-Cook really surpasses all of the 'competition' as far as MVC tools are concerned! Try love it and get cooking!