Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [files]

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

0
votes
1answer
26 views

How to change upload destination from public to private when there are uploaded files in database? [duplicate]

There are a few fields that uses public upload destination. I changed it globally right now, as far as I know it uses private upload destination from now. But how can I change previously uploaded ...
0
votes
0answers
9 views

How do I show webform file in email as text only, not a link to the file

I want to store uploaded files in private file system which users cannot access. How to I show the uploaded file name as text only in a confirmation email instead of a link to the file which they ...
0
votes
1answer
14 views

File widget custom upload location

I am working on a custom module (based on Model project) with a file field attached to my custom entities, now I would like to save files in certain directories according to entity id eg: public://...
0
votes
1answer
15 views

Custom Ajax forms with managed_file form element

We have a form with three fields - where depending on the value of the first select field, we will show the other two form elements - one select field (the options depends on the value of the first ...
2
votes
1answer
21 views

Firefox can't download private PDFs

I have an issue with FireFox where it can't download generated private file PDFs, yet Chrome has no such issue. We populate PDF files with TCPDF and they get moved and copied into a few different ...
0
votes
0answers
11 views

REST: 403 forbidden for file entities

Ok, so this is a weird one... I have a HEADless Drupal that I'm using to serve webform submissions. The webform module stores all files as private files. The issues I'm having is if I view the ...
0
votes
0answers
14 views

Change media reference from private to public?

We have a site that has well over 500 files that were uploaded into the private file system. Management wants a change in functionality, however, that allows people to directly link to the media ...
0
votes
2answers
50 views

Moving the Sites/Default/Files Directory

We have a client with simple request to move the Public File folder up simply so that links will be shorter like example.com/files/ instead of example.com/sites/default/files/. I assumed this would ...
1
vote
0answers
12 views

How to customize the file display

I have a problem that I'm unable to solve. I created content type named test player to display files with Able Player, that is an accessible audio player for blind users. So, I installed requested ...
0
votes
0answers
18 views

Menus, drush uli link, and some images not working after moving site to localhost

I've just gotten a site I'm supposed to do some work on but I'm having trouble with migrating to a local development environment. I don't have admin access to the site itself, but I do have access to ...
-1
votes
0answers
29 views

How to show progress bar in file field?

I have "Assessment" content type and having one field called "Goal Sheet" with type file. In this field I'm able to upload .xlsx, .zip formate. Here i want to show progress bar while uploading file. ...
0
votes
1answer
36 views

How to validate allowed file types in custom module

I want to validate a field with accepted file type as PDF, XLS, JPEG, JPG, GIF, ZIP, RAR and PNG. I'm getting file types as PDF, XLS etc. here is part of my code. if ($fi_name!='') { if ($...
0
votes
0answers
24 views

Comment file upload not working

Looks like we have two versions of jQuery loading. Hence the "(...).once is not a function" errors in the console. jquery.once is definitely loaded but only for the first version of jQuery. Nightmare....
1
vote
0answers
17 views

How to initiate “Download” of the file? [closed]

For my website I have created a view, where with the help of "Views Bulk Operations" a user can check some entities and with the help of 3d party library (PDFMerger) the pdf files, related to the ...
0
votes
0answers
11 views

Thumbnails not created for specific image file extensions (case sensitive)

This is a strange issue. Ever since I installed Drupal 8 (currently 8.6.3) on a managed HostPapa host, I cannot get thumbnails to display for specific file extensions. When I watch the browser dev ...
-2
votes
1answer
33 views

Which method creates the cache directories inside sites/default/files

I am trying to solve the question SETGID bit gets reset for newly created directories inside sites/default/files. Please Note the Update-2 there. I want to know which method creates the directories ...
1
vote
2answers
97 views

How to save files to a private directory?

I am writing a custom module in which data is written to a file and the file is stored in a private directory folder. In order to do so I have created a private directory and assigned required ...
0
votes
0answers
31 views

Webform file/image upload fails

I manually created the docroot/sites/default/files/private folder, cd docroot/sites/default/files/ | chmod 755 -R private and chown -R www-data:www-data private Flushed the cache, and still ...
0
votes
1answer
41 views

File Types Question

Is it possible to store .obj and .dwg files and/or Unity asset bundles in a Drupal CMS? If so, is it then possible to use API requests to upload and download these files? Cheers
1
vote
0answers
28 views

check whether a user downloaded a file from private system file? [closed]

What I wanted to do is to show a tick icon (just next to download link), after a member downloaded a private file, which implemented by Protected File Module (files are saved on private file system). ...
1
vote
0answers
33 views

How to place private folder on another server?

I am designing a file store with Drupal 7. The server provider told me that I am not allowed to put the files in the current server and I have to purchase a download server beside the current server. ...
-3
votes
1answer
36 views

How to download a file from a system folder when a link is clicked? [closed]

I have a file("abc.csv") that is stored in the local system (for example: /var/a). I need to download the file when I hit a link in a Drupal site.
0
votes
0answers
13 views

Create an Automatic Post based on Folder Contents

I have a Drupal 7 website where I share audio, music sheets and text files with a select group of users. Think a music database where each user can contribute with their recordings, scores and all can ...
0
votes
0answers
7 views

Field type file - Invalid charset of a rendered description

I have UTF-8 as a global charset for a D8.6 website and all editable content works as expected except the rendered output of a file description / label value from a content field type file. At a ...
0
votes
0answers
40 views

How to create a Blob field type?

Is there a way or is it possible to add a Blob field type in Drupal 8? And save the files on the database? I know that there is a module Blob but it's for a Drupal 7.
0
votes
0answers
10 views

Update local file paths in body type fields across site

I need to move an existing d8 site from a standalone site to part of an existing multisite setup in d8. I would like the files to be in sites/$mysite/files instead of sites/default/files. However, the ...
2
votes
1answer
54 views

How to add an extra field in file upload widget?

I know that it is possible to enable a description field in the core file upload widget for Drupal 7. However, I want to add an extra description field like the one already present. For this I've ...
0
votes
0answers
18 views

Is there a way of deleting a file field without deleting the related file entities?

I'm working on a site that started uploading files via specific Fields appearing in Content Types, but has since moved to uploading them via admin/content/file/add for consistency. I'd like to delete ...
0
votes
1answer
35 views

How do I fix File Upload After Upgrading to PHP 7

I know this question has been asked a thousand times in a thousand different ways, but none of those solutions have worked for me. Problem: I recently updated from php5 to php7. Whenever I attempt to ...
0
votes
1answer
27 views

How to add a title text input to an image field node form widget

If you have an image field widget in a Drupal node form you can automatically edit the image alt text in there, but is it also possible to add a title text field? When I install the File Entity ...
0
votes
1answer
26 views

How to make file description field as required?

I would like to set the file description as required. I tried it with this code: function mymodule_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) { if ($form_id ...
0
votes
1answer
28 views

Link to content within node, from CKEditor WYSIWYG

This seems like it should be fairly simple, but I'm having trouble getting off the ground. I have a content type "Document". This content type has a field of type File, which allows for uploading PDF'...
1
vote
1answer
43 views

Unpublished file still downloadable

I have a file attached to a node via a link. The node is published but the file is unpublished. The link on the node points to the file /sites/default/files/file.txt The file is still downloadable by ...
3
votes
1answer
229 views

Delete “permanent” file when it has 0 uses

Files that are "used in 0 places" (viewable at /admin/content/files) are not being deleted automatically by cron. They also show a status of permanent. How do I allow these files to be deleted by cron,...
0
votes
2answers
93 views

How to overwrite a file upload so that the filename is always the same?

I am trying to implement a file upload form in which files are saved. I had written the following code <?php /** * @file * Contains \Drupal\avenue_product_import\Form\avenue_product_importForm....
0
votes
0answers
17 views

Should I use a 'URL', 'Path', or other form field type when the field is used to define the location that a file should be saved

I have an administrative form that allows a user to set the save location of a file. I'd imagine that valid locations would be public://foo, private://foo, and /foo/bar/foo. What is the proper form ...
0
votes
0answers
11 views

Move site with links to many assets

I am charged with migrating several pages from one Drupal site to another. There are many files that are linked on the pages (128 pdfs on one page alone) and those will need to be moved as the source ...
1
vote
1answer
29 views

Get link address of a file

I have a page A that has an inline entity form that is referencing to page B, it's possible programmatically or in another way to get the link address of a file that page A is referencing to?
0
votes
1answer
50 views

Image Styles Not Generating Thumbnails/Previews

I have File Browser installed on my website. The module info can be found here: https://www.drupal.org/project/file_browser When I go to browse for pictures, there are no images. You can see what I ...
-1
votes
1answer
220 views

Rest File upload octet-stream uploaded file is corrupted

I use rest to post upload file (no file_entity, but core file) following direction in https://www.drupal.org/project/drupal/issues/1927648 In the app I use FileRider to get file binary for post body. ...
3
votes
1answer
51 views

Managed File is stuck with a temporary URI, even after saving it as permanent file

I was having this problem: Files uploaded via custom configuration form are eventually lost. So, I used the solution, basically: $file->setPermanent(); $file->save(); But then, even thou $...
0
votes
1answer
34 views

How to use (reference) the uploaded file to a media(video) type?

I have read https://www.drupal.org/node/2941420 and I can upload a image file then use it in article. But I can not use it as video field after I upload a video file. My Drupal version is 8.6.0-...
1
vote
1answer
28 views

How to save file with custom form?

I try to use that script in my Drupal site https://tutorialzine.com/2013/05/mini-ajax-file-upload-form I did not use drupal form api. I used my html same with that script. I created 2 pages with ...
0
votes
1answer
27 views

How to restrict file access based on file path under private directory?

I have a list of files under sites/default/files/private/abcde/manuals/. I want to add restriction to the files based on certain logic which I can add in the code in a hook. The logic would be based ...
0
votes
1answer
73 views

Save and set an external link image programatically

I have a field that will accept an image link coming from the external source. But of course, to set that image I have to save it in Drupal first. I'm wondering how do Drupal save the image from an ...
0
votes
1answer
28 views

Links to files breaking

I just wanted to see if anyone could offer some thoughts or opinions on an issue we are having. We are running Drupal 8 multisite via Aegir. We have a production environment and an identical testing ...
0
votes
0answers
48 views

How to change from Token based file download to normal path file download

I am trying to attach the document(pdf) in CKEditor using "Add Media" option. The problem is that it is making the path to download the file like this "https://domain/file/fid/download?token=xxx" ...
4
votes
1answer
416 views

How do I set permissions for a subdirectory that Drupal creates when uploading a file?

I'm using Drupal 8 and the Flysystem module to configure remote file storage via SFTP. My question probably applies in general, though. When a file is uploaded, and the file directory setting has a ...
0
votes
1answer
10 views

500 error on one page in entire site only showing error “You are here” instead of administration content

this error seems to only affect one page in on the website, and nowhere else. Here is what it looks like: The watchdog reports do not show the issue, and I believe it to be a permission error or ...
0
votes
0answers
16 views

Why is my user getting logged out before reaching hook_file_download()

I'm having problems where my logged-in users are trying to access a file (in private file area) but when they get to the hook_file_download() function of my module, they are coming through as user 0, ...