PHP 8.3.31
Preview: File.php Size: 1.07 KB
/home/getspomw/royalsquad.us/vendor/symfony/mime/Part/File.php

<?php

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Mime\Part;

use Symfony\Component\Mime\MimeTypes;

/**
 * @author Fabien Potencier <fabien@symfony.com>
 */
class File
{
    private static MimeTypes $mimeTypes;

    public function __construct(
        private string $path,
        private ?string $filename = null,
    ) {
    }

    public function getPath(): string
    {
        return $this->path;
    }

    public function getContentType(): string
    {
        $ext = strtolower(pathinfo($this->path, \PATHINFO_EXTENSION));
        self::$mimeTypes ??= new MimeTypes();

        return self::$mimeTypes->getMimeTypes($ext)[0] ?? 'application/octet-stream';
    }

    public function getSize(): int
    {
        return filesize($this->path);
    }

    public function getFilename(): string
    {
        return $this->filename ??= basename($this->getPath());
    }
}

Directory Contents

Dirs: 1 × Files: 8

Name Size Perms Modified Actions
Multipart DIR
- drwxrwxrwx 2026-04-21 21:31:49
Edit Download
2.23 KB lrw-rw-rw- 2025-09-17 06:53:20
Edit Download
1.49 KB lrw-rw-rw- 2025-09-17 06:53:20
Edit Download
4.50 KB lrw-rw-rw- 2025-09-17 06:53:20
Edit Download
5.18 KB lrw-r--r-- 2026-04-26 11:34:58
Edit Download
1.07 KB lrw-rw-rw- 2025-09-17 06:53:20
Edit Download
1.36 KB lrw-rw-rw- 2025-09-17 06:53:20
Edit Download
2.34 KB lrw-rw-rw- 2025-09-17 06:53:20
Edit Download
7.80 KB lrw-rw-rw- 2025-09-17 06:53:20
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).