Questions tagged [files]
Use it to generally reference to those files used on websites which could be video, images, pdfs, etc.
731
questions with no upvoted or accepted answers
5
votes
0
answers
340
views
Is there any way to add a file field for multiple upload file to a custom form?
I'd like to add a file upload widget to a custom form, with core file module, as shown in the admin edit node page. I've trying with the 'managed_file' API, but I've only got upload one file. I need ...
5
votes
2
answers
2k
views
Displaying the contents of a document file (doc, docx, etc.)
I'm looking for a way to display the contents of an uploaded document file such as a .docx file.
In Drupal 6 I used the iPaper module which did the trick as all I needed was api code to connect ...
4
votes
0
answers
458
views
Image styles are not generated in Docker for Windows
When I open in browser http://localhost:1567/sites/default/files/styles/thumbnail/public/2017-10/478069720_1384178114_4.jpg, I see 404.
The "original" images are uploaded successfully, and the ...
4
votes
1
answer
3k
views
How to rename uploaded files
Using Drupal 8, I want to rename and clean all filenames, e.g. If someone uploads file named like this Screen Shot 2016-03-29 at 1.13.21 PM.jpg, I want to clean it so that convert all spaces to dashes ...
4
votes
2
answers
1k
views
How to select files from /sites/default/files with IMCE filebrowser?
Somehow the settings of directories in the configuration of IMCE (7.x-1.7) is pointing to <root>/. which lets met start in the private_files directory but not in the (public) files directory.
I ...
4
votes
2
answers
1k
views
Upload file and fill in fields in one step; or trigger a rule when a file is uploaded
I want to make use of the Media module and the File entity module to upload files, in particular images, to my site without having to attach them to a node. Solely uploading images works like a charm, ...
3
votes
0
answers
284
views
Cannot delete file due to empty entity reference
I have been asked to delete a file that has incorrect legal information on it from a website so it has to go. My users could not do it.
The site is running drupal 8.9.13 and I have installed the ...
3
votes
0
answers
91
views
Image derivatives removed by some process, only regenerated when switching to maintenance mode, then removed again
While moving a bunch of legacy D7 sites to a new server, I bumped on the following problem with one site only. This is certainly NOT the classical permissions issue on files directory.
Bug description
...
3
votes
1
answer
1k
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'...
3
votes
1
answer
900
views
How capture video thumbnail , when video is uploaded under media video type file?
I'm using Core media module to upload video[Media Type is video,which has field video of 'file field type'].
This module will refer video.png as thumnail for all video uploaded from the local system.
...
3
votes
1
answer
271
views
How do I utilize Drupal commerce to sell large files stored on Amazon S3
I am working on a project for work that involves replacing a current "tape and staple" file delivery system. It's a Drupal site, but with many many third party outdated VERY unstable software. However,...
3
votes
1
answer
387
views
Drupal prevents file save on chunked upload because of php.ini max upload size
I'm encountering a tricky problem with my custom file widget (which extends the core file widget). It chunks files so that I don't have to raise upload_max_filesize and post_max_size in php.ini, and ...
3
votes
0
answers
681
views
Error saving custom field type module with "managed_file"
I have created a custom field type module (field plugin) containing four fields: title, description, address, image.
Drupal version: 8.02
This is the schema structure inside FieldType php file:
...
3
votes
0
answers
497
views
How to populate a managed file field with ajax
Problem
I have a large form with a select field tied to an ajax call. When an option is selected a large chunk of the form is rebuilt and a number of fields re-populate.
All the fields pre-populate ...
3
votes
0
answers
847
views
Unzip a file in Drupal 7 Form API and upload extracted files
I'm creating a custom form using Drupal 7 Form API, and I need my users to be able to select a ZIP file containing a number of other files. I'd like to be able to extract the files and then upload ...
3
votes
0
answers
4k
views
"View private files" permission not effective
I have 3 users, an administrator, an uploader, and a viewer. The uploader has a file field attached to his profile and the destination folder of the uploaded (in my case .pdf) file is set to the ...
3
votes
0
answers
712
views
How to pipe file uploads to subdomain?
I've got a Drupal 7 site on Apache and Varnish, sitting behind the CloudFlare CDN. Everythin on mysite.com goes through cloudflare... I also have a "direct access" subdomain set up at direct.mysite....
3
votes
1
answer
301
views
How can I generate commerce file audio preview automatically?
In a store of music files with the Commerce File module, how can I generate an audio preview of that file? Would be perfect if I could use the Rules module for detect the adding of file and SOX ...
2
votes
0
answers
512
views
Allow users to upload heic images and auto-convert to jpg
It seems that heic images are increasingly popular way to store images (the default image format since ios 11, but browsers do not support them. Site visitors may attempt to upload an heic image from ...
2
votes
1
answer
242
views
Drush can't write to /tmp
Drush does not seem to be able to move files to the tmp folder on my local machine. Changing the tmp folder location to for instance "sites/default/files" works, but I would like to know why ...
2
votes
0
answers
404
views
I cannot access PDF files uploaded in the private directory
PDF files uploaded to the private directory cannot be viewed and returns a 404 error.
This also happens to the user with the Administrator role.
Other file types can be viewed with no issue.
This ...
2
votes
0
answers
137
views
S3FS IMCE File upload issue for old files in Upgraded site
I have a question on IMCE File upload. Hope someone might have come across the similar issue.
Installed modules:
https://www.drupal.org/project/s3fs
https://www.drupal.org/project/imce
We have added ...
2
votes
0
answers
181
views
Theming a file link by adding custom file name suggestions
I want to display a bunch of data inside a view table, where each dataset has up to three different files. The user should be able to download these files by clicking a custom button or image in this ...
2
votes
0
answers
334
views
Updating a Node image field from an external URL
I need to retrieve an image from an external URL and then save the image on Drupal's file system, and then set the image as the image for a node. In D7, this was a pretty simple task, but it's causing ...
2
votes
0
answers
243
views
How can I download protected files using the REST API?
How can we download the protected files using the REST API by using the BasicAuth?
I've tried below code with BasicAuth
var settings = {
"url": "domain/system/files/guides/docs.pdf&...
2
votes
0
answers
348
views
migration using csv and yml for multivalued image field
some problem with sub-process plugin. Here are my yml and csv files.
uuid: c0948690-b539-421e-b306-6a49d14afd64
langcode: en
status: true
dependencies: { }
id: migration_multivalues
class: null
...
2
votes
0
answers
123
views
How do I use hook_entity_access() to let anonymous users upload private files?
I have same issue described in
How to skip the ReferenceAccess constraint on a file upload by an anonymous user?
So I need to use hook_entity_access() or hook_ENTITY_TYPE_access() to solve the issue.
...
2
votes
1
answer
465
views
User can't access own private files via Views
I've set up a private directory sites/default/files/private and use it for a file field.
As an admin, everything works as expected when uploading and viewing a private file.
As a user who uploads ...
2
votes
0
answers
378
views
How do I display the file size of attachments on a node templates?
Is there any way to display the file size of attachments on a node through the node template programmatically?
I read How do I display the attachment's file size of a node? but it seems that the ...
2
votes
0
answers
1k
views
Drupal 8 Private file is accessbile by anonymous user
I have created a content type with file field and set Upload destination is private files. I have also set the $settings['file_private_path'] = '/path/to/private'. But the file is accessible by ...
2
votes
1
answer
598
views
How can I load CSS files located outside the web root from within a custom module?
I need to store my css files at a location outside Drupal's path (e.g. /srv/assets/css/my_site/general.css). I attempt to achieve this using drupal_add_css but the browser loads them from:
http://www....
2
votes
1
answer
1k
views
How to get an export option as a pdf for views?
I am using views on my Drupal site I can able to export my view in csv, but I am not able export my views as pdf I need to export my view as pdf. Any suggestions on this it will be very helpful, ...
2
votes
0
answers
201
views
wysiwyg module and imce missing upload button
I am attaching an image....i have wysiwyg module with cke library and also imce module and imce bridge module.
When I click browse to upload images, i get a nonfunctioning screen....It does not work ...
2
votes
0
answers
5k
views
How can I upload an image file using multipart/form-data?
I want to send an image file using REST API in Drupal 8 along with a registration form. I have built a custom API to save the registration form.
For the files I have created another API to save data ...
2
votes
0
answers
105
views
Using Views without Database Support
We build a Drupal 8 based content management system that uses a triple store as the main data back-end. So we don't have any content data in Database tables. All CRUD operations on entities stored ...
2
votes
0
answers
92
views
Private files broken
I just moved a site to another server (Windows IIS 8.5). Public images are working perfectly, but private images seem to be broken.
By having a look at the browser's inspector, I can see that when I ...
2
votes
1
answer
1k
views
How do I integrate media (e.g. attaching audio) to nodes?
I installed the Media Entity module for Drupal 8. I thought it would somehow facilitate adding Mp3, etc, as Media does in Drupal 7, where I could specify a media player type for an audio file. (And ...
2
votes
0
answers
27
views
Getting a node-uniqe identifier such as node id or path as replacement pattern at node creation
I have a content type which consists of a large text field and a number of file fields. Users are allowed to /node/add instances of this content type and are then expected to upload all relevant files ...
2
votes
0
answers
976
views
How to upload my video using Video module and CKEditor?
I'm trying to upload my custom videos to my Drupal 7.28 site. I want to add videos in my most of the posts or pages.
I've installed the Video module and also have CKEditor module working. Is there ...
2
votes
0
answers
75
views
Add a confirmation step on file upload
I'm trying to add a confirmation step when I upload a file (file_entity). After I upload a file that exists already on the server, I want the user to be asked if he really wants to replace the ...
2
votes
1
answer
112
views
How handle large number of images in gallery node Drupal 7
I have some gallery nodes with a large number of images (100+), the upload with Plupload integration module works fine, but after save the node and edit it again the node edit form loads 20+ seconds! ...
2
votes
1
answer
330
views
How to hide path location in drupal 7?
How to hide path file in drupal? Now it looks like this:
http://localhost/drupal/sites/default/files/document.pdf
I want to change to look something like this:
http://localhost/drupal/media/view....
2
votes
0
answers
193
views
Entityform send uploaded files as link and not as an email attachment
I am using Entityform to send email notification to admin when visitors submit a form with an uploaded PDF file. How do you get the uploaded file to be provided as an email attachment and not as link?
2
votes
2
answers
1k
views
How can I attach multiple pdfs to drupal_mail() function?
Was doing something like this
global $base_url;
$uri = $base_url . '/sites/default/files/test.pdf';
if(!empty($mail_content)) {
/*send mail */
$to =$...
2
votes
1
answer
236
views
How to Make File Description Field Required?
Use case: Users who are authorized to use the edit page are required
To upload at least one file
Must have an associated description with the file.
Plus: How can I edit "Description" to display "...
2
votes
0
answers
33
views
Thumbnail directory name
I'm creating a video hosting website, the thumbnails are uploaded manually, because i couldn't configure ffmpeg because of shared hosting. I would like to retrieve a videos thumbnail from the server, ...
2
votes
1
answer
170
views
Unique file system for multiple domains in Domain Access
I have created five domains using domain access module like
test1.com
test2.com
test3.com
etc,
Now i want each users from different domains have to use unique file system in order to upload media.
...
2
votes
0
answers
287
views
Video Embed Field module - how do I add attribute 'id' to the embed youtube iframe?
The question is related to DRUPAL modules name is 'Video Embed Field' module.
The default output of this module generated the Youtube iframe embed as set in the config by Administrator. But...
The ...
2
votes
0
answers
65
views
"managed_file" type element not showing in my custom block configure form
I have been creating a portfolio section for my one page theme and I created a module for these section blocks. Now, I'm using the hook_block_configure to set the data into the blocks.
Only 1 "#...
2
votes
1
answer
211
views
FieldCollection/PLUpload - Recurring error when uploading images on PROD - "No file by that name exists"
TL;DR Pantheon's distributed file system can't handle modules that refer to the temp file system across multiple requests, which messes up the Plupload module. What alternatives are there?
The error ...