This topic contains 3 reply and 2 voices, and was last updated by towhid 4 years, 2 months ago
Viewing 3 Posts - 1 through 3 (of 3 total)
Author Posts
September 8, 2015 at 4:40 pm 70958
towhid Hi, is there any way to restrict file upload to only accept .doc format Thanks
September 9, 2015 at 3:52 pm 71110
towhid towhid

Hello Shabir,

Please paste this code at the bottom of the theme’s functions.php file. It will be better if you create a child theme. Then this code will be intact if an update comes up for a parent theme.

add_filter( 'wpuf_allowed_extensions', 'booking_text_cb' );
function booking_text_cb( $extesions ){
    $extesions = array(
        'images' => array('ext' => 'jpg,jpeg,gif,png,bmp', 'label' => __( 'Images', 'wpuf' )),
        'audio' => array('ext' => 'mp3,wav,ogg,wma,mka,m4a,ra,mid,midi', 'label' => __( 'Audio', 'wpuf' )),
        'video' => array('ext' => 'avi,divx,flv,mov,ogv,mkv,mp4,m4v,divx,mpg,mpeg,mpe', 'label' => __( 'Videos', 'wpuf' )),
        'pdf' => array('ext' => 'pdf', 'label' => __( 'PDF', 'wpuf' )),
        'office' => array('ext' => 'doc', 'label' => __( 'Office Documents', 'wpuf' )),
        'zip' => array('ext' => 'zip,gz,gzip,rar,7z', 'label' => __( 'Zip Archives' )),
        'exe' => array('ext' => 'exe', 'label' => __( 'Executable Files', 'wpuf' )),
        'csv' => array('ext' => 'csv', 'label' => __( 'CSV', 'wpuf' ))
    );
    return $extesions;
}

Thanks

September 10, 2015 at 5:05 pm 71299
saku4388 saku4388

Hi,

But this is not working

Please check here http://44dicndri.in/abstract-submission/ in abstract field.

Try to upload a text file and it is not giving me any warning but try to upload a image file it gives an error like “You have uploaded an incorrect file type. Please try again.”

Also i just want to restrict this on Abstract field not on any other.

September 16, 2015 at 12:22 pm 72001
towhid towhid

Please provide your login details(also FTP) by using this form: http://wedevs.com/provide-login-details/. I will have a look what is going wrong.

Thank you 🙂

Viewing 3 Posts - 1 through 3 (of 3 total)