The file could not be uploaded because the destination PATHNAME is invalid

Created on 30 August 2022, almost 3 years ago
Updated 29 March 2023, about 2 years ago

I cannot get the configuration path settings to work. I've tried multiple subpaths in my directory, but each time I attempt to upload a file, I get this message:

The file could not be uploaded because the destination "/sites/default/files" is invalid. Of course, that file directory is obviously in my tree. So what am I missing??

I've tried all variations and nothing is working. Please advise how to configure this field.

🐛 Bug report
Status

Active

Version

3.0

Component

User interface

Created by

🇺🇸United States arlingtonvoicellc

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.

  • 🇺🇸United States superfluousapostrophe

    The solution by @Loyarc in #6 did it for me. It would be nice for the module to suggest some options such as temporary:// or public://.

  • 🇺🇸United States Kristen Pol Santa Cruz, CA, USA

    I have used public://sites/default/files/testing with success so I agree that the description for the

    Upload location
    

    field could include a couple examples so people don't trip up on this.

    Anyone want to create a tiny patch?

  • Assigned to Kristen Pol
  • 🇺🇸United States Kristen Pol Santa Cruz, CA, USA

    I might add a little something for the next release so assigning to me.

  • Issue was unassigned.
  • 🇺🇸United States Kristen Pol Santa Cruz, CA, USA

    I've been slammed with many other things, so unassigning from me.

  • 🇮🇹Italy kopeboy Milan

    It's weird because the first time I created a bulk upload configuration (with a simple string like my_folder), I could upload in bulk, then I re-created it or created a new one and I started getting that error during bulk upload.

    Using temporary:// revealed another error (with any Form mode selected in the configuration):

    No media files have been provided.

    but the images are below, unselected, and even if I select them and try to submit, I get the error again.

    If in the configuration I leave the Upload location field empty (please note it's not required), the error I get when uploading the files is

    The file could not be uploaded.

    On a local (DDEV) Drupal 10.4.7, without Dropzone JS submodule.

  • 🇮🇹Italy kopeboy Milan

    Actually this issue can be just about setting a correct path, which can be public://tmp or temporary:// (they should work after fixing the other related issue). To use private:// you must first set the private file path in your settings.php.

    Still TODO: improve the help text of the Upload location field

    I'm not an expert dev so I'll leave it to others.
    (Sorry for the noise).

Production build 0.71.5 2024