Title: Using with WPDM
Last modified: July 26, 2017

---

# Using with WPDM

 *  Resolved [randomuser2000](https://wordpress.org/support/users/randomuser2000/)
 * (@randomuser2000)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/using-with-wpdm/)
 * I am trying this plugin to work with WordPress Download Manager. Here some code
   from WPDM about plupload. What modification we need to make it work?
 *     ```
           $plupload_init = array(
               'runtimes'            => 'html5,silverlight,flash,html4',
               'browse_button'       => 'plupload-browse-button',
               'container'           => 'plupload-upload-ui',
               'drop_element'        => 'drag-drop-area',
               'file_data_name'      => 'package_file',
               'multiple_queues'     => true,
               'max_file_size'       => wp_max_upload_size().'b',
               'url'                 => admin_url('admin-ajax.php'),
               'flash_swf_url'       => includes_url('js/plupload/plupload.flash.swf'),
               'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap'),
               'filters'             => array(array('title' => __('Allowed Files'), 'extensions' => '*')),
               'multipart'           => true,
               'urlstream_upload'    => true,
   
               // additional post data to send to our ajax hook
               'multipart_params'    => array(
                   '_ajax_nonce' => wp_create_nonce('wpdm_admin_upload_file'),
                   //'action'      => 'wpdm_admin_upload_file',            // the ajax action name
                   'action'      => 'tux_big_file_uploads',            // the ajax action name
               ),
           );
   
           $plupload_init = apply_filters('plupload_init', $plupload_init); ?>
   
   
           function uploadFile(){
               check_ajax_referer('wpdm_admin_upload_file');
               if(!current_user_can('upload_files')) die('-2');
   
               $ext = explode('.', $_FILES['package_file']['name']);
               $ext = end($ext);
               $ext = strtolower($ext);
               if(in_array($ext, array('php', 'js', 'html', 'py', 'pl', 'htaccess'))) die('-3');
   
               if(file_exists(UPLOAD_DIR.$_FILES['package_file']['name']) && get_option('__wpdm_overwrrite_file',0)==1){
                   @unlink(UPLOAD_DIR.$_FILES['package_file']['name']);
               }
               if(file_exists(UPLOAD_DIR.$_FILES['package_file']['name']))
                   $filename = time().'wpdm_'.$_FILES['package_file']['name'];
               else
                   $filename = $_FILES['package_file']['name'];
   
               do_action("wpdm_before_upload_file", $_FILES['package_file']);
   
               if(get_option('__wpdm_sanitize_filename', 0) == 1)
                   $filename = sanitize_file_name($filename);
   
               move_uploaded_file($_FILES['package_file']['tmp_name'],UPLOAD_DIR.$filename);
   
               $filename = apply_filters("wpdm_after_upload_file", $filename);
   
               echo "|||".$filename."|||";
               exit;
           }
       ```
   
    -  This topic was modified 8 years, 10 months ago by [randomuser2000](https://wordpress.org/support/users/randomuser2000/).

Viewing 1 replies (of 1 total)

 *  Thread Starter [randomuser2000](https://wordpress.org/support/users/randomuser2000/)
 * (@randomuser2000)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/using-with-wpdm/#post-9360461)
 * I figured it out.

Viewing 1 replies (of 1 total)

The topic ‘Using with WPDM’ is closed to new replies.

 * ![](https://ps.w.org/tuxedo-big-file-uploads/assets/icon-256x256.png?rev=2551772)
 * [Big File Uploads - Increase Maximum File Upload Size](https://wordpress.org/plugins/tuxedo-big-file-uploads/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/tuxedo-big-file-uploads/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/tuxedo-big-file-uploads/)
 * [Active Topics](https://wordpress.org/support/plugin/tuxedo-big-file-uploads/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/tuxedo-big-file-uploads/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/tuxedo-big-file-uploads/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [randomuser2000](https://wordpress.org/support/users/randomuser2000/)
 * Last activity: [8 years, 10 months ago](https://wordpress.org/support/topic/using-with-wpdm/#post-9360461)
 * Status: resolved