0

I'm working on a form that allows users to submit several files. I have a form created that includes several managed files. I need a way to process the file after it's been uploaded to ensure that it contains the data I need. Is there a way to do this? All the code I've seen on the internet talks about processing files but doesn't show to call the code in the first place.

My form element looks like this:

$form['commlink_fid'] = array(
  '#type' => 'managed_file',
  '#title' => 'The file to upload',
  '#default_value' => variable_get('commlink_fid',''),
  '#upload_location' => 'private://uploaded_files/',
  '#upload_validators' => array(
    'file_validate_extensions' => array('zip'),
  ),
);
  • "I need a way to process the file after it's been uploaded" - what do you mean by "after" - when exactly? – David Thomas Jun 23 '13 at 23:02
  • I need to inspect the file right as it's uploaded and before the end user submits the form. – Robbert Jun 24 '13 at 16:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.