{"id":23863484,"url":"https://github.com/beechit/default_upload_folder","last_synced_at":"2025-10-26T21:15:31.371Z","repository":{"id":15335793,"uuid":"55602959","full_name":"beechit/default_upload_folder","owner":"beechit","description":"TYPO3 extension to configure different default upload folders","archived":false,"fork":false,"pushed_at":"2024-06-06T19:34:49.000Z","size":74,"stargazers_count":10,"open_issues_count":5,"forks_count":20,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-08-10T23:18:07.839Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/beechit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2016-04-06T12:14:02.000Z","updated_at":"2024-06-06T19:33:48.000Z","dependencies_parsed_at":"2023-01-13T18:22:29.531Z","dependency_job_id":null,"html_url":"https://github.com/beechit/default_upload_folder","commit_stats":{"total_commits":65,"total_committers":17,"mean_commits":3.823529411764706,"dds":0.7076923076923076,"last_synced_commit":"79f3c62f0250805ec27d9a3c3d8664d900cea5d0"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beechit%2Fdefault_upload_folder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beechit%2Fdefault_upload_folder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beechit%2Fdefault_upload_folder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beechit%2Fdefault_upload_folder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/beechit","download_url":"https://codeload.github.com/beechit/default_upload_folder/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232308552,"owners_count":18503119,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-03T08:00:01.155Z","updated_at":"2025-10-26T21:15:31.301Z","avatar_url":"https://github.com/beechit.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Default upload folder\n=====================\n\nMake it possible to configure the default upload folder for a certain TCA column\n\n**How to use:**\n\n1. Download from TER or require (`composer require beechit/default-upload-folder`) extension default_upload_folder\n2. Install extension default_upload_folder via the extension manager\n3. Create the default folders or the folder is automatically created *(Editors needs access to storage and the folder\n   root)*\n4. Add configuration to pageTs\n\n```\n    default_upload_folders {\n        # folder can be a combined identifier\n        tx_news_domain_model_news = 1:news\n        # Or a folder relative to the default upload folder of the user\n        tx_news_domain_model_news = news\n\n        # You can set a folder for the whole table or for a specific field of that table\n        tx_news_domain_model_news.fal_related_files = news_downloads\n        tx_news_domain_model_news.fal_media = news_media\n\n        # You can set a fallback for all tables\n        defaultForAllTables = 1:myDefaultUploadFolderForThisPartOfTheTree\n\n        # You can set a default year/month/day folder within the set default folder\n        tx_news_domain_model_news.dateformat = 1\n        tx_news_domain_model_news = 1:news/{Y}/{m}\n    }\n```\n\n**FAQ**\n\n_What happens when the editor does not have access to the upload folder?_\n\u003e The \"Select \u0026 upload files\" and \"Add media by URL\" buttons are not available for the editor\n\n_How do the fallbacks work?_\n\u003e 1. First it will check if there is a default upload folder for the table \u0026 field combination.\n\u003e 2. Then it will check if there is a default upload folder for the table.\n\u003e 3. Finally, it will check if there is configuration for `defaultForAllTables`\n\n_Are folders automatically created?_\n\u003e Yes, but only if path set with combined identifiers like 1:myNewsPicturesFolder\n\n_How to use the year/month/week/day feature?_\n\u003e 1. Make sure the variable `tx_mews_domain_model_news` has the `dateformat` value set to `1`.\n\u003e 2. Then (over)write the original variable however you prefer: `tx_news_domain_model_news = 1:news/{Y}/{m}`\n\u003e 3. This will translate into: `1:news/2023/06` which in turn creates the directory: `news/2023/06`\n\n_Why does the year/month/week/day feature not use the php strftime function \u0026 format?_\n\n\u003e The strftime function has been deprecated in PHP 8.1, and will\n\u003e be [removed in PHP 9.](https://www.php.net/manual/en/function.strftime.php)\n\u003e\n\u003e Currently, there is no proper solution that takes localisation in consideration. Hence, the choice to create a custom\n\u003e interpreter.\n\u003e The values used are based on the [date() -\u003e Parameter Values](https://www.w3schools.com/php/func_date_date.asp)\n\u003e format.\n\u003e the values currently in use are:\n\u003e - Y - A four digit representation of a year\n\u003e - y - A two digit representation of a year\n\u003e - m - A numeric representation of a month (from 01 to 12)\n\u003e - n - A numeric representation of a month, without leading zeros (1 to 12)\n\u003e - d - The day of the month (from 01 to 31)\n\u003e - j - The day of the month without leading zeros (1 to 31)\n\u003e - W - The ISO-8601 week number of year (weeks starting on Monday)\n\u003e - w - A numeric representation of the day (0 for Sunday, 6 for Saturday)\n\u003e\n\u003e The other values are currently **not** in use.\n\u003e\n\u003e This functionality might be refactored in the future when php offers a proper replacement to the removal\n\u003e of `strftime`.\n\n**Requirements:**\n\n\u003e TYPO3 V12.4\n\n**Changes TYPO3 V12:**\n\n\u003eConverted from Hook to Event, as Hooks are depricated.\n\u003e \n\u003e Specifically: https://docs.typo3.org/m/typo3/reference-coreapi/12.4/en-us/ApiOverview/Events/Events/Core/Resource/AfterDefaultUploadFolderWasResolvedEvent.html\n\u003e \n\u003e Added Services.yaml (as required for Event handling)\n\u003e Now receives $backendUserAuthentication directly from $GLOBALS['BE_USER'].","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeechit%2Fdefault_upload_folder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbeechit%2Fdefault_upload_folder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeechit%2Fdefault_upload_folder/lists"}