This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

info2940
info2940

When i try to upload a csv file to assets folder from dashboard, The error pops up and denies the file type. It says

Error uploading file "test.csv": Only the following file types are allowed: jpg, jpeg, bmp, png, gif, css, js, woff, svg, ttf, eot, json, md, less, sass, scss".

It seems not support csv extension. Can I store csv files anywhere else?

Last updated

tetsuya-takiguchi3373
tetsuya-takiguchi3373

Hello! info2940.

Of the following files:

\[october directory]\modules\cms\widgets\AssetList.php

/**
 * @var array A list of default allowed file types.
 * This parameter can be overridden with the cms.allowedAssetTypes configuration option.
 */
public $allowedAssetTypes = ['jpg','jpeg','bmp','png','gif','css','js','woff','svg','ttf','eot','json','md','less','sass','scss'];

Please edit the above variables.

that0n3guy
that0n3guy

Directly editing modules\cms\widgets\AssetList.php is a bad idea. It will get overwritten on the next update (potentially).

From the docs shown in that file, it says to override the allowed file types by adding a the info to the cms.php config file.

So basiccally, edit your app/config/cms.php file and add something like the following to the bottom:

'allowedAssetTypes' => ['jpg','jpeg','bmp','png','gif','css','js','woff','svg','ttf','eot','json','md','less','sass','scss'],
tetsuya-takiguchi3373
tetsuya-takiguchi3373

Hellow that0n3guy!

Aha! I did not know to be addressed in the next update. Thank you.

that0n3guy
that0n3guy

@tetsuya-takiguchi3373 , Please note, I wasn't saying this will be addressed/fixed in the next update. I was saying that editing CORE files like the cms module COULD be overwritten in any update.

1-5 of 5

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.