File names are automatically hyphenated

File names are automatically hyphenated.
I want to put the file url inside the <source> html.
However, the file name does not appear as a normal url.
(For example:

Did I do something wrong?

When I put it in the cover, it worked normally.


            type: files
            multiple: false
            label: Video
            type: files
            multiple: false


         <?php if ($cover = $new->cover()): ?>
          <div class="videobox">
            <video controls preload="none" poster="<?= $cover->url() ?>">
              <?php if ($videobox = $new->videobox()): ?>
              <source src="<?= $videobox->url() ?>" type="video/mp4">
              <?php endif ?>
          <?php endif ?>

You need to convert your field to a file object first:

<?php if ($cover = $new->cover()->toFile()): ?>
1 Like