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
-2
votes
0answers
18 views

Generate file-managed field from db bytea value in Drupal 8 [closed]

I want to generate a file-managed field with values already stored in a table in bytea format. The files are loaded and displayed properly but the remove ajax in not working. Working in Drupal ...
0
votes
1answer
21 views

How can I restrict access to a static HTML page served from a subfolder of my site to authenticated users only?

I have a Drupal 8 site that has all roles and permissions necessary for authenticated users. One of the new requirements is to serve a static microsite (like a campaign site, totally different design ...
0
votes
0answers
17 views

Access denied on creating field 'status'

Uploading image via API http://drupal.local/entity/file?_format=hal_json API responding error Access denied on creating field 'status' when adding status field. I am using that API with credential of ...
0
votes
0answers
18 views

Why is the Downloading file size unknown despite Content-Length headers set with file size in bytes?

During Downloading files the size is unknown "0B" despite having set the "Content-Length" headers with the bytes (see $http_headers below) Content-Type (String, 15 characters ) application/zip ...
1
vote
0answers
39 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 ...
1
vote
1answer
55 views

Folder permission errors on public:// after upgrade to 8.8.5

I'm new to this community, and asking for help because I'm stuck on this problem, and cannot go past. I've also tried asking on StackOverflow, but with no luck so far. My current setup: Drupal 8.8.5 ...
0
votes
1answer
18 views

How do I add a file upload button?

I have a view and have styled the view with a Twig template. The view show nodes whose content type is Programs. I would like to add a Upload button in the view so that admininistrator users can add ...
0
votes
1answer
23 views

How to make a private file visible after changing file URI?

My task is automatically convert image files to pdf, when they are attached to a certain field. So the field accepts both the images and pdf files, but converts uploaded images to pdf. The field saves ...
0
votes
0answers
28 views

How do I load a file as entity knowing its full path?

I want to replace a file entity while uploading it via hook_entity_insert(). I upload a file using its full path, for example /var/www/web/sites/default/files/test.png I convert it to some another ...
0
votes
1answer
32 views

Where can I set the following HTML attribute to my custom field?

I'm developing a custom module with an image field. Where can I set the following HTML attribute to my custom field? <input type=file accept="image/*" capture=environment> I ...
0
votes
0answers
20 views

File field edit form change display style attachments

I need help. I would like change display attachments when edit entity. Default Drupal display attachments in table but I need change this to eg. unordered list or anything else - how to? I found many ...
-2
votes
1answer
28 views

Is it possible to bypass the local filesystem completely using an alternative filesystem?

I'm using a cloud hosting provider to host a Drupal site (7 moving to 8) with a huge amount of static file assets. The host charges a lot for file space, so I'm wondering if there's a way to bypass ...
-2
votes
1answer
21 views

Unicode Library [closed]

I am currently having "Requirements problem" with Drupal. When I 'Verify requirements' at the start, I get an issue of not being able to continue. Unicode library Multibyte string ...
0
votes
2answers
31 views

How do I load a Media entity from a File entity?

I have a File entity loaded programmatically. I want to load a Media entity from it. Is there a way to achieve this?
0
votes
0answers
18 views

How to upload image to media library? (No upload field)

I'm missing something in media_library. When I click "Add media" in the media library (/media/add/image) there's no browse/upload field. All of the other media types have an upload field. This ...
0
votes
1answer
18 views

In node add, how to upload file using image from clipboard

How can I paste image from clipboard and save into image_field ?
0
votes
0answers
36 views

How to set different root folder access for different roles in elFinder

I'm using drupal 7.69 and elFinder 2.1.46. A private page is showing elFinder browsing window with 2 root folders root1 |-dir1 |-dir2 root2 |-dir3 |-dir4 I am trying to setup 2 roles: ...
0
votes
0answers
39 views

What exactly is affected by “Default download method” setting?

At /admin/config/media/file-system is option Default download method (public or private files) which sets "the preferred download method". I am not sure what exactly is affected by this setting? ...
0
votes
0answers
38 views

Unable to upload a file

I have configured a file field to be encrypted with a RSA profile (via File Encrypt module). Everything works fine on the DEV environment (Windows) but when I deploy on the TEST environment (Linux), I ...
0
votes
1answer
13 views

Private files get Access Denied for any non-admin role but only on server

Very odd problem. I have a bundle where a user uploads a file to a private file field. When viewing the bundle; they see the file listed and can see it is linked to the file; but when clicking the ...
0
votes
0answers
18 views

How can i move public file directories files & folders to the public file directory in drupal 8? [duplicate]

I want to change the file directory path to private from public but i don't know how to move the previously uploaded files to the private directory.
0
votes
1answer
20 views

Append current query string to private file urls?

If I use template_preprocess_file_link, can I add the current url query string and append it to the link per user? Will this link be cached for all users? Update: This appends it, but does seem to ...
0
votes
2answers
51 views

Download file after filling a form [closed]

On my site, the visitors can download whitepapers as pdf. I would like to gather some information before handing over the file. Updates: the downloads should be open to unregistered users What I ...
0
votes
1answer
27 views

How do I programmatically create a file and write it in the private:// folder?

How do I programmatically create a text file and write to it in the private:// folder in Drupal 8.8? I found some examples, but all of them use deprecated functions and they don't work. Here what I ...
0
votes
0answers
23 views

Solution for Job application form with file using NUXT + DRUPAL

Ok, so I am working on a project (Using NUXT.JS for frontend) for a company where I need a job application form. I am using Drupal as headless CMS. Everything is fine so far. I have created multiple ...
2
votes
1answer
52 views

How to alter file upload description text

I'm trying to customize text for a file upload widget in Drupal 8. Here is a screenshot of the widget: I just want to display the first 15 MB which I added as file field description text in the ...
0
votes
0answers
32 views

How can I upload an image in a custom form and save the result in a custom database table?

I have a custom form and I want to store the values in a custom database table. After submitting the form, the first_name and email_address fields are successfully saved to the database, but image ...
0
votes
1answer
25 views

Add extra text input for file field

For Drupal 7, in page content type there is a multiple file upload section. Description is enabled for the file upload, but I need to add one more text input for each images to ask user enter the year ...
0
votes
1answer
25 views

How to add Download link to File field

I would like to know how I can make File field type display the upload as a download link, instead of having a link. So that user can just click and it will download). The file field type, I added to ...
0
votes
0answers
67 views

When I try to load an media entity with $mid and entityTypeManager->getStorage get nothing

I'm trying to generate a field formatter, and I get this error: Error: Call to a member function getStorage() on null en Drupal\svg_url\Plugin\Field\FieldFormatter\Url4SvgFieldFormatter->...
1
vote
0answers
110 views

How can I re-populate file_usage and file_managed tables?

I have a commerce website. I am also consuming a web service and creating corresponding products, including matching products with another table's rows. I have the below code. It ran several times and ...
0
votes
0answers
36 views

Create a link to a private file from just a file id?

I am building a controller that returns a rendered HTML Response object to an AJAX request in the theme. I need to display a button that contains a link to a private file. I tried to mimic what the ...
0
votes
0answers
14 views

How to get the node title which is related to file in File usage view?

I am just trying to list out the nodes which are linked to files in the File Usage view. That will show up in this URL: /admin/structure/views/view/files/edit/page_2. In this view I tried to add ...
1
vote
0answers
27 views

Bug remove file button in webform multi upload file

Module: Webform 8.x-5.5 Context: Multi file upload webform Bug: When I'm removing a file from the uploaded list, the label of all the file disapear... But, when I upload an other file, they all ...
0
votes
0answers
88 views

How can I read uploaded CSV file data and create nodes from it?

I have created custom module. but don't know how to read uploaded file data and add into perticular content type. HTML File upload is displayed but after upload file unable to read content. function ...
1
vote
0answers
81 views

Why would redirected files create 404's at website's root? [closed]

When my Drupal 7 site was built (not by me), there was a schematic file field created within our "Tool" nodes to upload tool schematics PDF files with the file directory set to sites/default/files/...
2
votes
1answer
31 views

How to get the media that owns a file?

I have a file and I know there is a media that references it. How can I get this media? In the opposite direction, knowing the media id, I can get the file: $media = Media::load($mid); $fid = $media-...
0
votes
0answers
18 views

How to get a second private files directory?

is it possible to create a second private files directory in addition to the existing private files directory? For a better file structure diversity I would like to set a different second location. ...
1
vote
0answers
88 views

Entity browser or Media Library for PDF uploads?

Client has a custom Content Type for for downloadable PDF document detail pages, which contains an entity reference to the File media type. They want Full and Teaser view modes to display a thumbnail ...
0
votes
2answers
663 views

How do I programmatically attach a file to a file field in a node? [closed]

I have a custom content type with a file field. I am trying to attach a file uploaded through a custom form to the custom content type. I am able to load the node and update all the other values of ...
1
vote
2answers
71 views

How do I remove the appended string from image and Javascript URLs?

I have a Drupal 8 website. I have installed the Advagg module. The URL for the JavaScript file has a string appended. https://example.com/libraries/superfish/superfish.js?pzw4cp https://example.com/...
0
votes
1answer
31 views

How to add a local image file to an image field programatically

I have serveral image files in the folder /sites/subsite.example.com/files/blog.dir/1/gallery1, and I need to add these files to a node programatically. I think this is the right code: use Drupal\...
1
vote
1answer
15 views

Using different .inc files with same function names in .module file

In our project, we have this module meant strictly for our custom API endpoints for our mobile applications to use. Currently, this is handled in a single .module file like so: my_project_mobile_api....
3
votes
2answers
74 views

Unable to retrieve uploaded file in submit handler

I'm creating a custom form with a file upload field that will have its contents read, processed then sent to an external API. The problem is whenever I upload the file the field for it appears to be ...
1
vote
2answers
101 views

How to reuse existing images in field type “Image”

I have custom ContentType with one field of type Image. Currently, when I edit a node I can only upload new images from local to server. I want to have the option to select images already existing on ...
0
votes
1answer
14 views

Modify the error message about the maximum upload file size

I would like to modify the default error message for the maximum upload file size, but I can't find the configuration. I looked at webform general settings, individual settings, and media file ...
0
votes
0answers
83 views

Upload button not showing

I am using Drupal 8.4.2. I have created my content type and I have an image field in the form fields. The image upload field is showing on the page but, the upload button is not showing. If I ...
0
votes
0answers
52 views

Detect when a new image is uploaded to my server

I have created a custom app that will allow logged in users to upload an image which will be automatically uploaded to my web server through SFTP method. Is there a module or even programmatically ...
1
vote
0answers
44 views

Remote File Upload with URL Parameters

I'm currently using a digital asset management tool that allows us to host images as a CDN. The DAM allows us to crop and position the image using URL parameters (example: https://embed.widencdn.net/...
0
votes
0answers
14 views

Storage API + Services 3: How to work together?

I am trying to set up a site that will be storing a large amount of images. I am using Storage API module for that and It is working fine through web. Now I need a REST Service to upload images. I am ...

1
2 3 4 5
47