Questions tagged [files]

Use it to generally reference to those files used on websites which could be video, images, pdfs, etc.

Filter by
Sorted by
Tagged with
-3
votes
0answers
16 views

facing problem files are not downloading on android mobiles [on hold]

i am using drupal7 for my website. also i have created web view android and IOS app for my website. files are downloading properly on laptop, pc, and IOS app. but on android mobile files are not ...
0
votes
0answers
18 views

Follow symlinks inside of default/files

I am running Drupal 8.7.6. The default/files directory is a symlinked to a read only mount (/mnt/files_ro). Drupal needs to write inside a few folders as it aggregates and caches assets, so I created ...
-3
votes
1answer
27 views

Upload file to S3 directly instead of using temporary storage

I have one file uploading form in Drupal 8 where I am uploading 3 different assets and they might be around 2gb or more in size. I have the s3fs module enabled and configured properly, but (due to ...
0
votes
0answers
33 views

Force download string as text file

I'm trying to return the results of a db_query as a raw text file. The php solution uses header() to instruct browsers to download content. I've attempted using header() in an AJAX callback function, ...
0
votes
0answers
26 views

How to make inline-files private based on role/permission by term

I am using permissions by term (https://www.drupal.org/project/permissions_by_term/) to manage a member-only area on my site. That works out easily and as it should. However, files uploaded in ...
-1
votes
0answers
19 views

ArchiveTar addModify fails when the passed file_uri has a white space in the filename

I trying to build an export function for a node in Drupal 8. This function needs to export a node's data as an Excel file and attached files as a tar.gz file. Like the webform module's download ...
0
votes
1answer
34 views

Additional file entity fields in widget_form

I've added additional fields to my file entity types and would like to have them in upload widget, just like file description. How can I add my custom fields element using field_widget_form_alter? (...
0
votes
2answers
51 views

Filebrowser thumbnails “can not create img for private://”

I am using Drupal 8.7.5 and PHP 7.3.7 running on Apache 2.4.6. UPDATE: I'm trying to make available a library of images to the public. I chose the content type of 'Directory listing' to do this. In ...
1
vote
1answer
66 views

How to set the public file path to migrate site files and images through Migrate Drupal UI

I am working on migrating a drupal 7 site to drupal 8 site that has image fields in content types, as well as some pdf files that I am trying to migrate through the Migrate UI. None of those files are ...
0
votes
0answers
7 views

Webform includes attachments only on manual resend, but not on initial form submission?

Using Webform and Mimemail to send HTML emails and uploaded files attached to emails. When submitting the form, the file is not attached to the email. The box is ticked: But if you edit the ...
0
votes
0answers
33 views

How can I migrate an Amazon S3 bucket to into Drupal?

SCENARIO I currently have a bucket where all my images are hosted and stored. I currently display them by simply using URLs that link to the images (i.e https://[bucketName].s3.amazonaws.com/[...
2
votes
1answer
27 views

File upload via REST returns 403

I've been attempting to get a file to upload using REST services and have been having a heck of a time getting it to work. All attempts come back as 403 (Forbidden). Here's the code: export const ...
0
votes
0answers
45 views

Files migration issue

I am following this tutorial on how to migrate files from D7 into D8. I have the migration setup with the following yml configuration: uuid: a685a4e0-1022-4bf2-a787-f6f1bef587ea langcode: en status: ...
0
votes
1answer
16 views

Form with manged_file filed is not submitted?

I have a form in my drupal module. in my form, I have used manged_file field. form name is "difference_form" and I have created two functions. one is "function diffence_form" for form definitions. ...
0
votes
1answer
68 views

D8 | Custom Form managed_file field limit number of upload files

I have a custom form in D8. Form has managed_file field. I am facing challenge regarding the limit of number of files upload to this field. I have to make this managed_file field to upload only 3 ...
0
votes
0answers
29 views

file_exists with 'replace' or 'use existing' not working when a variable is passed

Can somebody point out the fault in this snippet for downloading a file entity. I am trying to replace or use existing file dynamically using migrate_plus. When I give a variable it doesn't seems to ...
-3
votes
1answer
28 views

change of Public file system path [closed]

how can i change Public file system path in drupal 8 ? And can you tell more about how to increase the storage of database?
0
votes
0answers
8 views

Is it possible to use the path alias token as file path with filefield_paths module?

I'd like to use the path alias in order to create the folder structure of the uploaded file. First of all I could not find the correct token in the list and after a while decided to create my own ...
0
votes
0answers
13 views

Acess denied to files set as permanent in tmp folder

I made a module that saves custom files in the tmp folder when users add a product to the cart, and move the file to private folder when the order is submitted. If I set the file status to 0, users ...
0
votes
0answers
11 views

Files not being saved in sites/default/files

I am having a problem when I upload a file in Drupal 7 through content/files and click on add file. The URL path for the file is always saved as files/ instead of sites/default/files/. In ...
0
votes
0answers
27 views

Drupal 8 uploaded should be stored in certain s3 bucket

Currently, I'm facing an issue while uploading a file. I'm fetching the file tid with hook_entity_presave: $file_tid = $entity->get('field_photos_photos') ->getValue()[0]['target_id']; if(!...
-2
votes
1answer
23 views

Encrypt images before node saving and decrypt them when a node is viewed

I am searching for a way to encrypt images before saving them on server (private folder) and decrypt it when node is rendered for roles that have views permissions. I found the Encrypted Files module,...
0
votes
1answer
22 views

Programatically copy an image from user entity to webform submission entity [closed]

Using a custom webform handler, I am trying to copy an image from the image field (field_usr_avatar_img) located at the user account page to the image element (avatar_img) located at the webform ...
0
votes
0answers
17 views

File uploading issue

We're having issues uploading files. Some files encounter an error message that states The specified file temporary://p1dah901n910tl8lv14.tmp could not be copied, because no file by that name ...
0
votes
1answer
31 views

How to add file extensions while creating a field (type file) through the module installer.yaml?

I need to add 4 fields to an existing content type in Drupal 8 website, 2 of them is text another 2 is file type, I have a multisite setup and have 30 country-specific sites so I need to add for every ...
0
votes
0answers
24 views

Steps to make a private file system working on a fresh install?

How can i make my media files stored as private and protected? The users shoud only have access to that file if they click from the node file link, on nodes they can access to. On a fresh install,the ...
0
votes
1answer
36 views

How do I override the base URL for private files?

Why in Drupal 8 is possible to override the base_url for public files using the file_public_base_url but not for private files? There are scenenarios where Drupal is installed behind a reverse proxy. ...
0
votes
0answers
43 views

Prompt user to download file via AJAX form submission

I have a file that is generated when an AJAX button is clicked. I want to immediately have a file download prompt come up. The file is being generated and has the correct data in the file. I just don'...
0
votes
0answers
34 views

Images not being uploaded to defined Image Style folder on server

Drupal 7 site. For over 5 years we've had no trouble uploading images to view with a blog. This weekend we had Ningx loaded on our server. Hosting co. is certain that's not issue. Maybe it isn't. ...
0
votes
1answer
130 views

Drupal 8.7.0 chmod() and touch() operations not permitted

After updating drupal8 for 8.7.0 and then to 8.7.1 versions i have next errors: Warning: chmod(): Operation not permitted in Drupal\Component\PhpStorage\MTimeProtectedFastFileStorage->save() (line ...
-2
votes
1answer
51 views

Not able to access uploaded images in AWS

When we upload an image using the URL 'https://website.com/file/add' , the image is getting uploaded. While uploading, we have chosen the destination as ' Public local files served by the webserver' ...
0
votes
0answers
13 views

Using image styles with a normal “managed file”?

I created a content type with 4 fields on it: Private Image Field Public Image Field Private File Field Public File Field I am able to access 1 and 2, as they are image fields. But if I upload an ...
0
votes
0answers
17 views

How can I get an image form to maintain image order after deleting one?

I have a content type with a field for images. The field accepts multiple images and after I upload several, I re-arrange them to a desired order. After re-arranging them, I can enable "Show Row ...
0
votes
1answer
32 views

How to download from private// following a link?

I have a custom entity (contract) created in a custom module (amap) by a bunch of BaseFieldDefinition, one of which being $fields['file1'] = BaseFieldDefinition::create('file') ->setLabel(t('...
0
votes
0answers
8 views

managed_files with named that already exist are being renamed, but original file name returned

I am trying to add image upload functionality to my custom module. Images are successfully being uploaded via the following: ` $form['slide']['dbs_img'] = array( '#type' => '...
0
votes
0answers
39 views

Grant file access to file downloads

I am able to sell a file using Ubercart Drupal 8 module. However, file download permissions are not granted to the user purchasing the file. Do we have a Rule in place for this? How can I achieve ...
0
votes
1answer
215 views

How to alter response headers from module hook

I am puzzled how to alter the response headers from specific hook (hook_file_download)? /** * Implements hook_file_download(). */ function example_file_download($uri) { $scheme = FileSystem::...
-2
votes
1answer
43 views

Strategy for Import/exporting Drupal8 as content and structure

We are setting up feature>dev>production environments on Platform.sh for a Drupal 8 project. Expecting multiple contributors to the project, we have run into a slight snag regarding Importing/...
1
vote
2answers
160 views

Download file programmatically

I have a custom module where I need to create a file and download it on form submission. So far, I managed to created the file and save it in public folder, but I cannot find a way to download it to ...
0
votes
0answers
23 views

How can I bulk add multiple taxonomy terms to existing media files, or reimport with terms?

At an earlier stage of a project approximately 30,000 files were uploaded to a Drupal 8 site through the Bulk Media Uploader. Now the project requires that taxonomy terms in an existing vocabulary be ...
1
vote
1answer
188 views

Will my managed file get deleted?

At this url: /admin/config/media/file-system There is a setting: Delete temporary files after X hours Does this specifically refer to files in /tmp ? Or whatever I set as my temporary folder? Or ...
0
votes
1answer
29 views

Can't Write to Public Files but Permissions Appear Fine

Need the internet to confirm my sanity. On a Drupal 7 site it's saying "The directory sites/default/files is not writable." So I checked every permission but I don't see the issue. Since this isn't a ...
2
votes
0answers
101 views

How can I create an alias to point to an uploaded file?

Users uploading a file within content create a name like my_site.com/sites/default/files/import/CrazyLongNamefile.pdf They would like to alias it for referencing in other media (print) like my_site....
0
votes
1answer
452 views

Get raw and relative path of a file uri

I have a file with an uri and I want to get its raw and relative path. Uri: public://videos/Test Video.mp4 Path: /sites/default/files/videos/Test Video.mp4 I found already a way to do this: $...
1
vote
1answer
213 views

Site seems to miss the “private” wrapper, how can I fix it?

I can not enable the private folder getting the warning as below: Warning: file_exists(): Unable to find the wrapper "private" - did you forget to enable it when you configured PHP? in ...
0
votes
1answer
32 views

File upload through form type file

My Drupal version is 8.6.10 I am trying to upload a file through the file_save_upload function and the function is looking for the file in Symfony\Component\HttpFoundation\FileBag Object $...
0
votes
1answer
111 views

How to download file from URL manually?

I need to upload on Drupal 8 a file from an URL programmatically without using a form and a field type 'managed_file'. I'm not sure how to do this, I found different web pages on it but it's often ...
0
votes
1answer
47 views

for anonymous user, webform not submitted because of private file

I have one webform which contain the private file field. As admin user: i can upload the file and submit the form. As anonymous user: i can upload the file but while saving the form, i am getting '...
0
votes
1answer
111 views

How to output multiple files url entities on twig?

I have a file entity field that I can upload multiple files and I'm trying to render or display it inside my node twig template. The code below is what I'm trying to make it display. Tried clearing my ...
0
votes
1answer
23 views

Where files are used if path entered by hand

I am brining a 100 or so static pages into my drupal install here. We are pasting the content from the static site into the body of a content type. I am using ICME to upload the images and documents. ...