Questions relating to files, both public and private including the file_managed database table

learn more… | top users | synonyms

0
votes
0answers
15 views

Images of some content types disappeared

I have something strange going on on one of my drupal installation. It seem's that for two content types all the images got unlinked from the existing entities. I can still see in the table ...
1
vote
1answer
15 views

How do you programmatically create a webform with a managed_file type?

I haven't been able to find a single example of how to create a webform with a managed_file type. The webform initially had the type 'file', but needs to be changed to accept multiple attachments. ...
0
votes
1answer
37 views

How can I get the URL to the public files directory?

I'm can get the path to the public files directory by using Filesystem::realpath: $path = $filesystem->realpath('public://'); But how can I get the URL of public://?
1
vote
0answers
22 views

Create module with managed file [closed]

I wanna create a page in my module with file managed upload, such as How make it? Show me source code please?
1
vote
0answers
36 views

Place CSS/JS aggregated files in a hierarchical directory structure

I use css and js aggregation for increase the speed of a drupal 7 website. Now, when I log in with user A, four news files (one css and one js) are added in the files website directory like that : ...
0
votes
0answers
21 views

user upload multiple pics for avatar approval

How to let user upload multiple pics for avatar approval in Drupal 7. 1) I used the avatar approval module, but I want to upload multiple images for different user?? 2) Different user can login ...
1
vote
0answers
37 views

Managed File element empty in $form_state on submit for anonymous user

I have a form built with Drupal 8 FAPI. It's a sophisticated "contact us" type thing which includes the ability to upload files. Among other things it includes several managed_file elements. The ...
0
votes
1answer
63 views

Drupal integration with external binary program to convert an image?

Using Drupal 8. On a cloud based site, I have a program for converting images into svgs that takes, at times, a few hours of run time. I can easily run the external binary program (configured to run ...
0
votes
0answers
17 views

Understanding Relationship Between `file_managed` and `file_usage` tables

I am trying to understand the Drupal database schema because I need to access the database via MySQL by another system and I do not have access to the original Drupal developer of the site nor do I ...
2
votes
2answers
33 views

Understanding `file_usage` table

I am trying to understand the Drupal database schema because I need to access the database via MySQL by another system and I do not have access to the original Drupal developer of the site nor do I ...
1
vote
1answer
15 views

Understanding `file_managed` table

I am trying to understand the Drupal database schema because I need to access the database via MySQL by another system and I do not have access to the original Drupal developer of the site nor do I ...
0
votes
0answers
21 views

Drupal Caching Files

After install and setup of my Drupal site, I've noticed that Drupal has placed a few dirs/files in my file directory like css/js. Is it safe to remove these files when I move my site? What other cache ...
1
vote
0answers
28 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 ...
1
vote
3answers
243 views

Storing data / session for anonymous user

I am working on a shop, and for the cart, i need to store items before payment. $tempstore = \Drupal::service('user.private_tempstore')->get('boutique'); $tempstore->set('poids', $...
0
votes
1answer
41 views

Is hook_file_download the right hook for taking action when a private file is downloaded?

I'm trying to create a module that will fire send an event via google analytics' Measurement Protocol API when a file is downloaded. These files are all in the private file system outside of the ...
0
votes
1answer
69 views

managed file problem with anonymous users and two managed file fields

I have a form with two '#type' => 'managed_file' fields. Anonymous user selects a file on field 1, clicks the Upload. Ajax upload occurs and the browse widget is replaced by the filename uploaded ...
0
votes
1answer
27 views

What is the Drupal 7 version of FILE_STATUS_TEMPORARY?

My use case is that I want to set an uploaded file as FILE_STATUS_PERMANENT until I know it has been processed correctly by my custom module. Once that is done, I'm happy for Drupal to delete it. ...
0
votes
1answer
19 views

How to delete a managed folder and its contents programmatically via hook_uninstall?

My hook_update_N() implementation looks like this: $directory2 = 'public://folder_name'; file_prepare_directory($directory2, FILE_CREATE_DIRECTORY | FILE_MODIFY_PERMISSIONS); How can I remove "...
0
votes
0answers
28 views

Configuration Management services.yml

I'm trying to change the configuration storage from database to files during a clean install of a Drupal 8 site. I've read the documentation and several tutorials, books outlining what is needed. I ...
1
vote
0answers
92 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: ...
0
votes
1answer
61 views

How to restore private file structure after major version update? [closed]

After a Drupal 6 to 7 update we are unable to use private image download, symptom is we cannot access private files via system/files, while public files can be loaded. Trying to download private file ...
0
votes
1answer
35 views

How to use file_save to store pictures into a folder on server?

what i want to perform (globally) is to import a csv file that contains data such as book_title, author, and the cover image of the books. The csv file is loaded, book_title and author are stored in ...
1
vote
0answers
23 views

is it possible to manipulate manage_file field on validation

Using the form api, is it possible to manipulate the managed_file field inside the validation function. For example if the fid of the field is 15, I want to change it to 10. It seems like it isn't ...
1
vote
0answers
31 views

( FAPI) Trouble Manipulating Managed Fields with Nested Field sets that can be added and removed dynamically

So my problem is this. I am trying to create a configuration form that allows you to control the front end of a page display. On the front page there are these regions, and each regions holds text and ...
1
vote
0answers
29 views

How to use Drag & Drop dnd:removeFile event?

I'm using Drag & Drop module to let users upload an image in their profile (I'm using a custom profile tpl). In that custom profile, I'm using in-place editable fields with AngularJS, so there ...
1
vote
1answer
26 views

Uploading and deleting unused images

I have a custom form with manage file input where users can upload their profile images. Upload looks like this: $acc = user_load($state['user_id'], TRUE); // upload profile image if ($state['...
0
votes
1answer
46 views

Managed file input is removing input values of appended input fields by ajax

I have a form with checkboxes that are calling ajax callback on checked. This ajax callback is appending another inputs: $form['expertise']['op-cat-'.$op_cat['id']]['op-'.$op['id']]['checked'] = ...
0
votes
1answer
81 views

create and save data to a file in the files folder from cron

I currently have some working example code where when a URL path i defined using hook_menu has been passed; My custom module will use file_get_path() to pull a txt file from another ftp server. It ...
1
vote
1answer
78 views

Get all managed file usage by id

Is there a way to get all the managed files used by a particular entity, i.e. a node or other module item? Looking in the file_usage table there is an id column and this is what I want to retrieve ...
0
votes
0answers
23 views

Drupal 7 large files from private file system not fully downloading

Files from private system are not fully downloading. When I download the file of 20MB or less it is downloaded perfectly. Files more than 20MB are not fully downloaded. For example after downloading ...
0
votes
0answers
7 views

Progrmmaticallly Add elements to file field

I am trying to add elements programmatically to a node's file field so it is rendered as it if it was native to the node. My first crack at this was to add it via theme_preprocess_node: function ...
0
votes
0answers
118 views

How to replace ajax callback of file upload in managed_file?

I have a text-area with some content inside. I have another form element that is for upload xls file. Now what I want to achieve is, when I click on upload button the xls file content should replace ...
1
vote
0answers
141 views

Drupal 8, The file used in the Image field may not be referenced

I am using managed file type to upload image in my custom form (Drupal-8). I am able to retrieve the given image while editing by using the below code $form['image_field'] = array( '#type' => '...
0
votes
1answer
27 views

How do I properly render a private file URI with l()?

If given a private file with a uri of private://Screenshot from 2015-12-07 15-52-42_0.png. How might I use l() to properly render the link? When rendered as follows I see https://server/drupal-...
0
votes
1answer
223 views

Default value of a 'managed file' field

I created an edit custom form (of a node) via a custom module. From this form, I have a "managed file" field (for one picture) and I set his default value to a fid; However, when my form is rendered, ...
0
votes
1answer
33 views

How to prepare directories in private file system?

I've configured private file system. Using it from UI works well. I want to generate dump site content via devel_generate with custom modifications. So I'm hooking into Node API for assigning sample ...
0
votes
1answer
197 views

Multiple upload image using managed_file

I'm trying to do a very simple thing (seems not that simple at all) in my custom form, to add multiple files using the managed_file form api. Like in the admin, select a file, upload, then a new input ...
1
vote
1answer
52 views

How can I programmatically remove the file from a managed_file form element?

I have a form where users upload images. When an image is submitted it is validated against various criteria. If the validation fails the user is returned to the form but the failed file is still ...
1
vote
1answer
50 views

Drush is always scanning the whole drupal directory?

Every time i run a drush command the command returns after 40s. (or more if time consuming operation like cache clean or so) After strace the command i realized that drush is scanning my whole drupal ...
0
votes
0answers
13 views

media browser only shows images

My media browser widgets only shows uploadet images. Not files of other types (.zip and similar). I need it to show uploaded files of all the following types - which the upload function already is ...
0
votes
0answers
18 views

Add random element to files in private so they can't be guessed

I want to add a random element to files in the /private/ directory so filenames cannot be guessed. In other words, when a file is uploaded by the admin I want the URL to download the file to be: /...
0
votes
1answer
75 views

How to change filename before it get saved without changing source URL using tamper plugin?

I've URL which is mapped to file field (image) via Feed Ex. I'm trying to change the filename before it's get saved using tamper plugins (e.g. concat or regex), however it is also changes the ...
0
votes
0answers
7 views

Resource manager table in the node edit does not show any resources

As the above screen shot shows, the table of resources of the current node edit is empty in-spite of the node has images and online videos. Is there common cause for this issue?
7
votes
1answer
671 views

Is it a problem when entity field storage info is not registered in the key_value table?

This is a Drupal 8 (beta 15) site, basic, few content types. On the status report page it says: Entity/field definitions Mismatch detected Mismatched entity and/or field definitions. After ...
1
vote
1answer
52 views

Moving / Migrating image files from another site into an existing Drupal 7 site

I'm currently doing a data migration from one Drupal 7 site to another Drupal 7 site. So far I exported the data from the old site into a CSV file and then have it get imported into the new site by ...
0
votes
0answers
18 views

managed_file field dependency

Can you change a field's value on a form once an file has been uploaded? I have a select field which checks the file system for certain files and then populates the options. I want the file upload ...
0
votes
0answers
39 views

Entity reference based tokens don't work with FileField Path

When I try to set up file path using FileField Paths module, entity reference tokens like [node:og-group-ref] don't work, nothing is returned. I tried to enable and disable all file path options, but ...
5
votes
2answers
165 views

How to move files already uploaded to a new subfolder?

I've got a bunch of files in sites/default/files that I'd like to move to a sites/default/files/subfolder to avoid a big mess. The fields uploading files have been configured to put them in the right ...
1
vote
2answers
38 views

arg() dependent hidden field in AJAX form

Basically, I have a hidden field I set using arg(). $form['slideid'] = array( '#type' => 'hidden', '#value' => arg(2) ); $form['fid'] = array( '#type' => 'managed_file', '#title'...
0
votes
0answers
100 views

Add attributes for 'managed file' form inputs

I am generating a form with drupal form api and using managed file form input for file upload, which is generating html for 3 inputs: <input type="file">, <input type="submit"> and <...