Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
24 votes
5 answers
19k views

How to set value of file field with entity_metadata_wrapper

How do you set the value of a file field when using the entity_metadata_wrapper? I've tried doing this in code: $file = new stdClass(); $file->uid = 1; $file->uri = $file_path; $file->...
Smos's user avatar
  • 647
8 votes
2 answers
6k views

Example of hook_file_download

How do I restrict the access to certain files based on their content type? I have the download section for registered users, and I want to prevent them to post links somewhere outside my site. Is ...
Pari's user avatar
  • 492
3 votes
2 answers
1k views

Image and other media file management

My question may seem vague but I'm confused and need advice on Drupal 7 media files management, so please bear with me. I'm looking for existing modules or ways to build the following functionality ...
Ari Linn's user avatar
  • 557
1 vote
1 answer
1k views

How to migrate fields attached to files?

I'm writing a file migration using migrate/migrate_d2d to migrate files from one Drupal 7 installation to another. Images have custom fields attached to them, including a text field "...
amacrobert's user avatar
1 vote
2 answers
531 views

Change values of nested fields with entity_metadata_wrapper

The background of this question is that I'm trying to migrate data from Drupal 6 Imagefield Extended to Drupal 7 File Entity (with File Entity Inline). See also https://www.drupal.org/node/974888 ...
yotka's user avatar
  • 417
0 votes
0 answers
1k views

Writing custom PHP code in Rules to check if a file field has a new value

I need to create a condition in Rules that evaluates whether a new file has been uploaded to afile field. The file field has an unlimited value setting and I need to send out notifications to users ...
alouette's user avatar
  • 133