# The Media folder and an issue with .mp3 files

**URL:** https://forum.getkirby.com/t/the-media-folder-and-an-issue-with-mp3-files/33235
**Category:** Questions
**Created:** [December 30, 2024, 12:58pm UTC](https://forum.getkirby.com/t/the-media-folder-and-an-issue-with-mp3-files/33235 "2024-12-30T12:58:10Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![bademeister](https://avatars.discourse-cdn.com/v4/letter/b/9de0a6/32.png) [@bademeister](https://forum.getkirby.com/u/bademeister)
#### Post date: [December 30, 2024, 12:58pm UTC](https://forum.getkirby.com/t/the-media-folder-and-an-issue-with-mp3-files/33235/1 "2024-12-30T12:58:10Z")

</div>

Hi,

My understanding in generell to the Media folder is to store resized images by a function for example, to hold the original one in the corresponding content folder. I guess that is not everthing, but this is my actual view.

In case of .mp3 files, Kirby has the same approach to store a copy of the .mp3 file in the Media folder. For me it makes no sense, because I have no changes to the audio file and more I have to spent double space on my webserver for every single .mp3 file.

What is the benefit in this standard approach to create a copy of an audio file into the Media folder and how can I disable this approch only for .mp3 files in case of no benefit?

Thank you

---

<div class="post-metadata">

### Author: ![David](https://avatars.discourse-cdn.com/v4/letter/d/aeb1de/32.png) [@David](https://forum.getkirby.com/u/David)
#### Post date: [December 30, 2024, 1:34pm UTC](https://forum.getkirby.com/t/the-media-folder-and-an-issue-with-mp3-files/33235/2 "2024-12-30T13:34:21Z")

</div>

Hi,

this article should help you

> **[Skip media folder](https://getkirby.com/docs/quicktips/purpose-of-media-folder)**
>
> Understanding the advantages of the media folder and how to serve files from the content folder if you prefer.

Cheers

David

---

<div class="post-metadata">

### Author: ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)
#### Post date: [December 30, 2024, 2:49pm UTC](https://forum.getkirby.com/t/the-media-folder-and-an-issue-with-mp3-files/33235/3 "2024-12-30T14:49:32Z")

</div>

Part 1: [Exploring the Starterkit | Kirby CMS](https://getkirby.com/docs/guide/tour#the-media-folder)

---

<div class="post-metadata">

### Author: ![bademeister](https://avatars.discourse-cdn.com/v4/letter/b/9de0a6/32.png) [@bademeister](https://forum.getkirby.com/u/bademeister)
#### Post date: [December 30, 2024, 3:30pm UTC](https://forum.getkirby.com/t/the-media-folder-and-an-issue-with-mp3-files/33235/4 "2024-12-30T15:30:31Z")

</div>

Thank you both!!!

For you all the best for 2025.

---

<div class="post-metadata">

### Author: ![bademeister](https://avatars.discourse-cdn.com/v4/letter/b/9de0a6/32.png) [@bademeister](https://forum.getkirby.com/u/bademeister)
#### Post date: [January 4, 2025, 8:59pm UTC](https://forum.getkirby.com/t/the-media-folder-and-an-issue-with-mp3-files/33235/5 "2025-01-04T20:59:18Z")

</div>

Sorry, I have to reopen this issue.

I considered the plugin based from the article, to exclude only video files from the media-folder. My change was only to substitude the parameter _video_ to _audio_ with:

```auto
<?php

// import App class
use Kirby\Cms\App as Kirby;

Kirby::plugin('cookbook/file-component', [
  'components' => [
    'file::url' => function (Kirby $kirby, $file) {
        // serve videos from content folder
        if ($file->type() === 'audio') {
            return $kirby->url() . '/content/' . $file->parent()->diruri() . '/' . $file->filename();
        // while all other files are served from the media folder
        } else {
            return $file->mediaUrl();
        }

    },
  ]
]);

```

Together with the necessary step to comment out a line in the _.htaccess_ file.

```auto
# block all files in the content folder from being accessed directly
# RewriteRule ^content/(.*) index.php [L]

```

Everthing is fine so far, the URL to my mp3-file is directed to the content folder and not more to the media folder, but nevertheless Kirby creates a copy of the mp3-file into the media folder!

Why?
