Code I'm using for a field is:
'DownloadFile' => array( '#title' => t("Download's download"), '#title_display' => 'invisible', '#type' => 'file', '#upload_validators' => array( 'file_validate_extensions' => array( /* extensions */ ), 'file_validate_size' => array(variable_get('max_size', 300 * 1024 * 1024)), ), '#upload_location' => 'public://mymodule/download', '#plupload_settings' => array( 'runtimes' => 'html5', 'chunk_size' => '10mb', 'max_file_size' => variable_get('max_size', 300 * 1024 * 1024) . 'b', ), ),
In form validation function I get thus in
Since the Views for Drupal 7 got reasonably stable, I was using Drupal 7 and managed files. I have literally no idea how should I take this file and plug it into managed table for other functions to use. As you can see from the time difference, it been some time between the moment I was able to upload and now - all this time with no idea. Tried to treat it as
'#type' => 'file', but functions for unmanaged don't get it. They require specific name and even if I add
'#name' to plupload form element, it still fails.
Is there any way to add file to managed table knowing it's location in