Basically I want to create a block with my module which's edit page has a few content fields and two image upload fields. When visiting the node where this block is rendered, I want to render the images with a certain image style, while on the edit form it would be cool to show the images as a thumbnail preview.
I am adding a field like described here: https://api.drupal.org/api/drupal/developer!topics!forms_api_reference.html/7#managed_file but this makes me curious:
New files are uploaded with a status of 0 and are treated as temporary files which are removed after 6 hours via cron. Your module is responsible for changing the $file objects status to FILE_STATUS_PERMANENT and saving the new status to the database.
Also, what is the difference of
file when I want to provide an image upload field?
Currently I have in hook_block_configure:
$form['left']['image'] = array( '#type' => 'managed_file', '#title' => 'test', );
Where do I define how this image shall be rendered (image style)? Do I have to set that permanent flag?