$form['search_results']['file_upload'] = array(
'#type' => 'managed_file',
'#title' => t('Thumbnail'),
'#default_value' => variable_get('file_upload'),
'#upload_location' => 'public://uploads/');

When using this, should managed_file create folder "uploads" if folder doesn't exists? If folder exists, regular users can't upload to that directory because of folder permissions, how to change that?

  • Securing file permissions has everything you need to know about file permissions (both what they should be and how to change them)
    – Clive
    Commented Oct 22, 2014 at 7:58
  • I'm creating a module, and I just want to upload images to folder "uploads"
    – josaric
    Commented Oct 22, 2014 at 8:19
  • I'm not sure how can I respond to that - if you read the link above your question will be answered
    – Clive
    Commented Oct 22, 2014 at 8:23


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.