Toggleable public/private upload

Created on 28 June 2011, over 14 years ago
Updated 25 January 2023, almost 3 years ago

The Drupal 6 Private Upload module allows you to choose at upload time whether a file should be put in the public or private file system. In Drupal 7, you choose public or private when you create the File field.

I would like to be able to choose public or private at upload time. I know whether the node I'm editing is going to be public or private, and want to choose the file upload to match.

Any reason this wouldn't be possible? Does a particular File field have to always be public or always private?

(OK, maybe this is a module suggestion or an 8.x-dev suggestion.)

Feature request
Status

Needs work

Version

10.1

Component
File module 

Last updated about 2 months ago

Created by

🇺🇸United States dhalbert

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇳🇱Netherlands seanB Netherlands

    Rerolled #38 for 9.5.x

  • 🇳🇱Netherlands EsfoNL

    small compatibility fix for Drupal 10 undefined call to file_move

  • 🇳🇱Netherlands EsfoNL

    fix stupid issue with previous patch where i passed the plain file object to move instead of calling getFileUri on it.

  • 🇳🇱Netherlands Johan den Hollander

    The #45 patch is a small step forward but some odd things:

    When creating a new Media entity with this patch enabled:

    First add file, then select private storage.
    -Upload a file
    -Select Private storage
    -Save entity
    -Edit media entity again.
    -Notice it has been stored as a public file.

    First select storage, then upload a file.
    -Set storage to private.
    -Upload a file
    -Notice that private has been reset to public, set to private again
    -Save entity
    -Edit media entity again.
    -Notice is has the correct setting, private storage.

    Now when you want to change the file from private to public it is not possible anymore. It will always be private.

  • last update almost 2 years ago
    Patch Failed to Apply
  • 🇳🇱Netherlands EsfoNL

    Used correct service this time.

  • last update almost 2 years ago
    Patch Failed to Apply
  • Status changed to Needs review almost 2 years ago
  • 🇮🇳India pradhumanjainOSL

    Try to fix patch #47.

  • Open in Jenkins → Open on Drupal.org →
    Environment: PHP 8.1 & MySQL 5.7
    last update almost 2 years ago
    Custom Commands Failed
  • Status changed to Needs work almost 2 years ago
  • The Needs Review Queue Bot tested this issue.

    While you are making the above changes, we recommend that you convert this patch to a merge request . Merge requests are preferred over patches. Be sure to hide the old patch files as well. (Converting an issue to a merge request without other contributions to the issue will not receive credit.)

  • Status changed to Needs review almost 2 years ago
  • Status changed to Needs work almost 2 years ago
  • 🇺🇸United States smustgrave

    Please include interdiffs with all patches.

    Issue summary could use some updating.

  • 🇳🇱Netherlands Johan den Hollander

    Updated the patch to be compatible with the latest 10.5.x release.

    Main differences:
    1. Updated imports in FileWidget.php to match Drupal 10.5.x structure
    2. Fixed import ordering to be compatible with current codebase

    core/modules/file/src/Plugin/Field/FieldWidget/FileWidget.php:
    - Added missing import for StreamWrapperInterface (line 14)
    - Added missing import for FileInterface (line 19)
    - Adjusted import ordering to match Drupal 10.5.x conventions
    - Added use statement for Drupal\Core\Url which was missing in patch #49

    Technical details:
    ------------------
    The original patch #49 failed to apply to Drupal 10.5.x because:
    1. The import structure in FileWidget.php changed between versions
    2. Additional imports (like Drupal\Core\Url) were added to 10.5.x
    3. The patch context didn't match the current file structure

    These changes make the patch compatible with Drupal 10.5.x while
    maintaining all the original functionality for the uri_scheme_field feature.

    All other functionality remains identical to patch #49.

Production build 0.71.5 2024