Home Forums Plugin Support WP User Frontend Pro Extend other file types in "File Upload"

This topic is: resolved

Tagged: 

This topic contains 3 replies, has 2 voices, and was last updated by  Oritro Ahmed 5 years, 2 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #20072

    Michael Chung Yeung
    Member
    Post count: 5

    Hi, how can I add other file types (eg. ai, tiff, tif etc) under the custom file upload field (beyond those currently permitted)? thanks!

    #20098

    Oritro Ahmed
    Spectator
    Post count: 155

    Hello Michael,

    You can add additional file type to wordpress. you can do that via adding some line to your themes functions.php. Before doing that, please check the MIME type of your desired filetype. You can find a pretty sophisticated list here,

    add_filter('upload_mimes', 'additional_upload_format'); 
    function additional_upload_format ( $existing_mimes=array() ) { 
    // Windows Executable Installer file 
    $existing_mimes['exe'] = 'application/octet-stream'; 
    // Word Perfect File  
    $existing_mimes['wp'] = 'application/wordperfect'; 
    return $existing_mimes; 
    } 
    

    Its pretty simple to use actually. $existing_mimes['wp'] change wp with the callsign and extension of the file. and change 'application/wordperfect' to your desired mime type.

    #20307

    Michael Chung Yeung
    Member
    Post count: 5

    Thanks for your help! It works!

    #20348

    Oritro Ahmed
    Spectator
    Post count: 155

    Happy to help.

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Extend other file types in "File Upload"’ is closed to new replies.