Project

General

Profile

Actions

Feature #83608

closed

Change default upload folder

Added by Sven Burkert about 6 years ago. Updated 3 months ago.

Status:
Closed
Priority:
Could have
Assignee:
-
Category:
Miscellaneous
Start date:
2018-01-18
Due date:
% Done:

100%

Estimated time:
PHP Version:
Tags:
Complexity:
easy
Sprint Focus:

Description

If an image is uploaded via "Select & upload files", it's stored in fileadmin/user_upload/.
It would be very useful, if you can overwrite this for specific pages, e.g. in Page TSconfig. For example for a page "news storage", where all images should be uploaded to fileadmin/user_upload/images/news/.


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #100358: Error while adding online media (youtube, vimeo)Resolved2023-03-30

Actions
Related to TYPO3 Core - Task #101038: Remove deprecated hooks in UserAuth classesClosedBenni Mack2023-06-13

Actions
Actions #1

Updated by Frans Saris about 6 years ago

Hi, this currently only possible by using some hooks.

See https://github.com/beechit/default_upload_folder that uses these hooks

Actions #2

Updated by Sven Burkert about 6 years ago

  • Priority changed from Should have to Must have
  • Complexity set to easy

Thank you for this hint and your extension, works great, I've configured upload paths for news, tt_content, pages and more.
But this should be really part of the core. I'm wondering this is not possible without extension.

Actions #3

Updated by Felix Nagel over 5 years ago

It seems in TYPO3 9.x it's possible to change the global default upload folder: https://docs.typo3.org/typo3cms/TSconfigReference/UserTsconfig/Options.html#defaultuploadfolder

It would be nice if changing the upload folder would be possible using TCA, probably as an option in \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig().

Actions #4

Updated by Markus Mächler over 5 years ago

I think it should even be possible to force an editor to choose an upload folder when he uses "Select & upload files". It is very tedious to first upload an image using the filelist and then go back to the record and setup a relation to the image just uploaded. There are cases where a human has to decide to which folder an image belongs, because there are no simple rules that could be used. The default upload folder could then be proposed to the editor, but he should still be able to choose a different folder.

Actions #5

Updated by Georg Ringer about 5 years ago

  • Status changed from New to Closed

check out the hook
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauthgroup.php']['getDefaultUploadFolder']
which is also used in the mentioned extension https://github.com/beechit/default_upload_folder/

therefore I am closing this issue

Actions #6

Updated by Christian Hackl over 4 years ago

  • Status changed from Closed to New

This is unfortunately not satisfactory, because you can't set the storage per dataset with the hook.
Because the hook provides me no UID of the record I can't get this to work.

For example if you have a TCA for a company - with a field "logo" - a field "images" and a field "movies", then I would like to be able to specify a separate folder for each company or want to create it automatically in which the files are stored / uploaded in an orderly way....

And not per BE user!

Actions #7

Updated by Frans Saris over 4 years ago

Did you have a look at https://github.com/beechit/default_upload_folder/ ?

As this is exactly the usecase the extension provides

Actions #8

Updated by Christian Hackl over 4 years ago

@Frans Saris
no cause the ext provides a solution for a per-page base (PID) not a solution for a per-record (UID) base.

Actions #9

Updated by Frans Saris over 4 years ago

It can handle per record/field and that for the whole pagetree or only for a specific page.

But you want to set it for instance a different folder for news item uid 1 than for uid 2?

Actions #10

Updated by Christian Hackl over 4 years ago

yes, for example:
news record uid -> directory
uid 1 (pid 1) -> directory 1
uid 2 (pid 1) -> directory 2
uid 3 (pid 1) -> directory 3

why? so that you can finally clean up the files (images etc.) automatically and the editor does not have to create folders beforehand - which has always been quite confusing with our previous experience. Sometimes a folder is capitalized, sometimes completely capitalized, sometimes small, sometimes underlined, sometimes without, sometimes with umlauts, sometimes without - and if an editor in the respective company changes and he was not properly instructed, sometimes everything lands directly in the user_upload folder...

In my current case, for example, I have FE-User which can upload files, these are now already beautifully in individual folders stored and in fact the record which they edit in the FE (automatically). In the backend this possibility is still missing so that a corresponding "sub"-admin must always create or search a folder first... that is not so nice and error-prone.

Actions #11

Updated by Julian Hofmann over 4 years ago

Combining UserTSconfig (-> defaultUploadFolder) with conditions (e.g. PIDinRootline) should be possible

Actions #12

Updated by Georg Ringer about 4 years ago

  • Status changed from New to Accepted
  • Priority changed from Must have to Could have
  • Target version set to Candidate for Major Version
Actions #13

Updated by Nikita Hovratov over 2 years ago

Maybe this could be brought into core?
https://github.com/beechit/default_upload_folder

Actions #14

Updated by Christian Hackl over 2 years ago

@Nikita Hovratov
thanks for the link, however this is not exactly what I want, it/we should be able to create folders automatically (for example at our own controller or hook) - e.g. new user registers (UserName: "Max Mustermann"), then the new user gets his own folder (name of the folder e.g. "user-max_mustermann").
Do you know what I mean? ;)

Actions #15

Updated by Gerrit Code Review over 1 year ago

  • Status changed from Accepted to Under Review

Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/76550

Actions #16

Updated by Gerrit Code Review over 1 year ago

Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/76550

Actions #17

Updated by Gerrit Code Review over 1 year ago

Patch set 4 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/76550

Actions #18

Updated by Gerrit Code Review over 1 year ago

Patch set 5 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/76550

Actions #19

Updated by Gerrit Code Review over 1 year ago

Patch set 6 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/76550

Actions #20

Updated by Gerrit Code Review over 1 year ago

Patch set 7 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/76550

Actions #21

Updated by Gerrit Code Review over 1 year ago

Patch set 8 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/76550

Actions #22

Updated by Gerrit Code Review over 1 year ago

Patch set 9 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/76550

Actions #23

Updated by Gerrit Code Review over 1 year ago

Patch set 10 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/76550

Actions #24

Updated by Gerrit Code Review over 1 year ago

Patch set 11 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/76550

Actions #25

Updated by Gerrit Code Review over 1 year ago

Patch set 12 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/76550

Actions #26

Updated by Gerrit Code Review over 1 year ago

Patch set 13 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/76550

Actions #27

Updated by Gerrit Code Review about 1 year ago

Patch set 14 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/76550

Actions #28

Updated by Gerrit Code Review about 1 year ago

Patch set 15 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/76550

Actions #29

Updated by Gerrit Code Review about 1 year ago

Patch set 16 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/76550

Actions #30

Updated by Gerrit Code Review about 1 year ago

Patch set 17 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/76550

Actions #31

Updated by Andreas Nedbal about 1 year ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #32

Updated by Jochen Roth about 1 year ago

  • Related to Bug #100358: Error while adding online media (youtube, vimeo) added
Actions #33

Updated by Benni Mack 10 months ago

  • Related to Task #101038: Remove deprecated hooks in UserAuth classes added
Actions #34

Updated by Benni Mack 3 months ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF