From a3f7aca8512feb091515ee773288b163032e6b89 Mon Sep 17 00:00:00 2001 From: Kong Jin Jie Date: Thu, 10 Jan 2019 13:16:18 +0800 Subject: [PATCH 1/3] Add documentation for additional file types --- .../14_Files/01_File_Management.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/en/02_Developer_Guides/14_Files/01_File_Management.md b/docs/en/02_Developer_Guides/14_Files/01_File_Management.md index 37b99c9af..e3b41dfba 100644 --- a/docs/en/02_Developer_Guides/14_Files/01_File_Management.md +++ b/docs/en/02_Developer_Guides/14_Files/01_File_Management.md @@ -120,6 +120,20 @@ As with storage, there are also different ways of loading the content (or proper | `File::getAbsoluteURL` | Gets the absolute URL to this resource | | `File::getMimeType` | Get the mime type of this file | | `File::getMetaData` | Gets other metadata from the file as an array | +| `File::getFileType` | Return the type of file for the given extension | + +### Additional file types + +There may be some file extensions not recognised by the framework, which will return "unknown" on `File::getFileType`. + +You can add your own file extensions and it's description with the following configuration. + +```yml +SilverStripe\Assets\File: + file_types: + ai: 'Adobe Illustrator' + psd: 'Adobe Photoshop File' +``` ## Modifying files From 7d23928fde6bd9589b727a04630697bcf452d412 Mon Sep 17 00:00:00 2001 From: Maxime Rainville Date: Thu, 10 Jan 2019 14:10:02 +0800 Subject: [PATCH 2/3] Update docs/en/02_Developer_Guides/14_Files/01_File_Management.md Co-Authored-By: jinjie --- docs/en/02_Developer_Guides/14_Files/01_File_Management.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/02_Developer_Guides/14_Files/01_File_Management.md b/docs/en/02_Developer_Guides/14_Files/01_File_Management.md index e3b41dfba..0025bcfa9 100644 --- a/docs/en/02_Developer_Guides/14_Files/01_File_Management.md +++ b/docs/en/02_Developer_Guides/14_Files/01_File_Management.md @@ -124,7 +124,7 @@ As with storage, there are also different ways of loading the content (or proper ### Additional file types -There may be some file extensions not recognised by the framework, which will return "unknown" on `File::getFileType`. +SilverStripe has a pre-defined list of common file types. `File::getFileType` will return "unknown" for files outside that list. You can add your own file extensions and it's description with the following configuration. From f34f1ec7eecc6d809c25753ec7ab2ae0541fa817 Mon Sep 17 00:00:00 2001 From: Maxime Rainville Date: Thu, 10 Jan 2019 14:10:07 +0800 Subject: [PATCH 3/3] Update docs/en/02_Developer_Guides/14_Files/01_File_Management.md Co-Authored-By: jinjie --- docs/en/02_Developer_Guides/14_Files/01_File_Management.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/02_Developer_Guides/14_Files/01_File_Management.md b/docs/en/02_Developer_Guides/14_Files/01_File_Management.md index 0025bcfa9..31c1393f0 100644 --- a/docs/en/02_Developer_Guides/14_Files/01_File_Management.md +++ b/docs/en/02_Developer_Guides/14_Files/01_File_Management.md @@ -126,7 +126,7 @@ As with storage, there are also different ways of loading the content (or proper SilverStripe has a pre-defined list of common file types. `File::getFileType` will return "unknown" for files outside that list. -You can add your own file extensions and it's description with the following configuration. +You can add your own file extensions and its description with the following configuration. ```yml SilverStripe\Assets\File: