File upload is not working We are using the file upload field in a custom drupal form, it was working for one (1) year but now it's not. It is working for administrators but not for anonymous users.

I am using the following code.

$allowed_exts = array('jpg jpeg gif png txt doc xls xlsx pdf ppt pptx pps odt ods odp docx zip rar');

      $form['file1'] = array(
        '#title' =&gt; 'Attachments',
        '#description' =&gt; t('Allowed Files - jpg jpeg gif png txt doc xls xlsx pdf ppt pptx pps odt ods odp docx zip rar'),
        '#attributes' =&gt; array('id' =&gt;'file_attachment'),
        '#type' =&gt; 'managed_file',          
        '#upload_validators' =&gt; array('file_validate_extensions' =&gt; $allowed_exts,)
      );
try to set the location

'#upload_location' =&gt; 'public://',