Table of Contents

File Uploader Extension

The MainWP File Uploader Extension is a simple way to upload files to your child sites from one centralized location. It gives you the ability to upload multiple files to all of your child sites simultaneously.

 

Upload Files to Child Sites

  1. Login in to your MainWP Dashboard
  2. Go to the MainWP > Extensions > File Uploader page
  3. Click the Choose File button and upload the wanted file (alternatively, drag&drop files to the marked area)
    File Uploader Extension 1
  4. Set a path where you want to upload your file(s)
    NOTE: If a directory does not exist on the child site, it will be created.
    File Uploader Extension 2
  5. Select Child Sites where you want to upload file(s)
  6. Click the Upload File button

Important Notes

The file that already exists with the same name in the same directory will be overwritten.

If you use space in the folder or file names, the extension will insert the “-” symbol to have a functional file path! For example: ../folder name/… or ../file name.png will be tweaked to ../folder-name/… or ../file-name.png

 

 

Supported File Types

  • .php
  • .css
  • .xml
  • .js
  • .txt
  • .zip
  • .rar
  • .ico
  • .html
  • .po
  • .mo
  • .jpg
  • .jpeg
  • .png
  • .bmp
  • .gif
  • .pdf
  • .doc, .docx
  • .ppt, .pptx, .pps, .ppsx
  • .odt
  • .xls, .xlsx
  • .mp3
  • .m4a
  • .ogg
  • .wav
  • .mp4, .m4v
  • .mov
  • .wmv
  • .avi
  • .mpg
  • .ogv
  • .3gp
  • .3g2

 

Add Support for a Custom File Type in File Uploader

By default, the MainWP File Uploader Extension doesn’t support all file types. By using the mainwp_file_uploader_allowed_file_types filter, it is possible to add support for any file type.

In this example, we will show how to add support for the JSON file type:

  1. Install and activate the MainWP Custom Dashboard Extension
  2. Go to the PHP section (MainWP > Extensions > Custom Dashboard > PHP)
  3. Paste the following code snippet and Save Chagnes:
add_filter('mainwp_file_uploader_allowed_file_types', 'mycustom_mainwp_file_uploader_allowed_file_types');
function mycustom_mainwp_file_uploader_allowed_file_types( $types ) {
   $types[] = 'json';
   return $types;
}

 

Important Notes

MainWP is not responsible for the files that you upload to your sites.

The File Uploader extension doesn’t allow uploading the .htaccess file.

This Extension upload files directly to your server, so treat it with the same care you would when uploading a file via FTP.

Not all web hosts permit all file types to be uploaded. Also, they may not allow large file uploads. If you are having issues, please check with your host first.

If you are having issues with uploading files, be sure to check that you are trying to upload a supported file type and that the file size is not over the limit declared by PHP Max Upload Filesize and PHP Post Max Size on your MainWP Dashboard server.

Still Have a Questions?
Search for additional solutions in the MainWP Community or start your own discussion