Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OPTION_UPLOADED_FILE_NAME_PATTERN does not write specified path on disk #6412

Open
Geolim4 opened this issue Aug 16, 2024 · 0 comments
Open

Comments

@Geolim4
Copy link
Contributor

Geolim4 commented Aug 16, 2024

Describe the bug
When you create an imageField field with a custom pattern:

        yield ImageField::new('documentFile')
            ->setColumns(4)
            ->setBasePath('api/v1/document/download')
            ->setUploadDir("uploads/documents/")
            ->setUploadedFileNamePattern('/[year]/[month]/[day]/[slug].[extension]')
        ;

The stored string in entity is good:
/2024/08/16/xxxxxxxxx.jpg

But the path written on disk is incorrect as it is
uploads/documents/xxxxxxxxx.jpg
instead of
uploads/documents/2024/08/16/xxxxxxxxx.jpg

To Reproduce

        yield ImageField::new('documentFile')
            ->setUploadDir("uploads/documents/")
            ->setUploadedFileNamePattern('/[year]/[month]/[day]/[slug].[extension]')
        ;

(OPTIONAL) Additional context
If they are useful, include logs, code samples, screenshots, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant