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

learn more… | top users | synonyms

0
votes
0answers
11 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 ...
0
votes
0answers
19 views

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

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 ...
0
votes
0answers
23 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
18 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 ...
0
votes
1answer
17 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
24 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
32 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
18 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
6 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
44 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 ...
0
votes
0answers
42 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
22 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 ...
0
votes
1answer
81 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
22 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
34 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
38 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
34 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
11 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
16 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
42 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?
1
vote
1answer
28 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
17 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
23 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
123 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
34 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', ...
0
votes
0answers
61 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 ...
2
votes
1answer
57 views

managed_file #progress_indicator never finishes

I've been beating myself up on this issue all week. This is my first time using file uploads in custom modules so I'm using managed_file. Here's a snippet of it that's being used: ...
0
votes
1answer
39 views

Managed_file form does not show #default_value

I am using managed_file in Drupal 7 for my custom module. Other than the form api and managed_file, I'm using my own custom tables for this module. This will eventually be used on shared hosting via ...
1
vote
1answer
45 views

How to unzip or uncompress a file .epub on Drupal?

I've created a content type that upload files .epub on database. Now for some reason (to use epub on a mobile app) I need to get the file .epub uncompressed. It's like in my content type I upload a ...
2
votes
2answers
62 views

User picture not removed when deleting user in Drupal 7

After creating users with a picture programmatically, and deleting them afterwards, I found out that the pictures (files) were not removed. I started digging into this problem and found out that this ...
0
votes
0answers
27 views

Upload to none public or private folders when using managed_file field type

Is there a way to use an arbitrary directory for uploading a file? One that is not the public or private folder? I do not mind if it doesn't save a record in the Database. $form['upload_logo'] = ...
0
votes
0answers
11 views

managed_field from theme in Domain Access

I created custom theme with some additional settings in it. Everything works fine when I change theme settings globally, but when I try to remove managed_file field's file (image) in the theme ...
0
votes
2answers
84 views

How to access and edit files from admin panel?

How i can acces my files without going to host control panel or by ftp. I mean if any module is for that to access and edit files from Admin panel.
0
votes
2answers
40 views

How to show fid with slideshow image

I have very specific requirement. I want to show images in slideshow. I have created content type "User Slideshow Snaps" and two fields Slideshow Snaps Node Id I want to show slieshow of images ...
0
votes
0answers
51 views

Add files to private directory?

I have set my "Private file system path" for uploaded private files (admin/config/media/file-system), but I am confused as to how to add any files to that directory. I expected to find a private files ...
0
votes
0answers
17 views

Display a file by different users

I have a problem when i want to see a file uploaded.I created a managed_file like this : $form['document']['footer_file'] = array( '#name' => 'footer_picture', '#title' => t('Footer ...
0
votes
0answers
34 views

URL variable getting lost when using upload button on a managed file

I have a D7 form that I made using the form API. The URL to the form contains a URL variable like so www.mysite.com/myform?id=123456. (I know it would be better to do www.mysite.com/myform/123456, but ...
1
vote
1answer
137 views

Files in the file_managed table with status of 0, not deleting on cron

I have a form where I am uploading files to the "sites/default/files" directory. I am using the managed_file type in my form API definition. This is all working fine and I notice that in the ...
1
vote
0answers
24 views

Uploaded files are not showing correctly in some users

Uploaded files are not showing correctly in drupal 7.12. However this issue occurs only with some old users and newly created users are working fine. what might be the cause of the issue. Can anybody ...
0
votes
0answers
17 views

exif custom mapped fields not filled with entity translation

We are filling custom fields in file entities with data from IPTC tags in images on upload. For that we are using exif_custom. Since we are using entity_translation the exif_custom mapped fields with ...
0
votes
2answers
30 views

file_usage_add issue for compound field

I have created a custom compound field which contains a managed_file element in the field widget form. The issue I am having is not with saving the file, but with adding the file usage information. ...
0
votes
0answers
10 views

How to manage file removals manually when using 'managed_files'?

I learned about FILE_STATUS_PERMANENT and file_usage_add recently in a custom module. My question now is what do I need to do to handle changes to the files in this module. If a user removes the ...
1
vote
0answers
80 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 ...
2
votes
2answers
155 views

Custom module 'managed_file' variable info keeps disappearing

I have a custom module which allows a 'managed_file' upload in the settings/config page. This works fine and displays as expected after uploading (with the filename linked, and a "Remove" submit ...
1
vote
0answers
27 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 ...
0
votes
1answer
35 views

I want to call a mymodule.functions.inc file

Hi all drupalers i am new in drupal coding i wrote a new drupal module that works perfecr but my boss wanted to put all my functions of my .module file in a new folder called 'includes' and in a files ...
0
votes
0answers
40 views

Problem with function from theme-settings.php in sub-theme

I want to create the sub-theme of my custom theme but I have the problem with the function from theme-settings.php. I have a few managed_file fields in my theme settings and my submit function for ...
1
vote
0answers
205 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 ...
1
vote
1answer
206 views

'Media File Selector' blank screen

To use already existing image, I choose 'Media File Selector' Widget. But, it gives me blank page like this when I click on 'Library' to choose already existing image in Drupal-7. Version of the ...