• Resolved lavalldesign

    (@lavalldesign)


    Isn’t there a possibility to allow only some types of documents (extension) and size?

    Because I only want them to be able to upload .pdf, .jpg or .png and limit the size.

    • This topic was modified 4 years, 5 months ago by lavalldesign.
Viewing 1 replies (of 1 total)
  • Thread Starter lavalldesign

    (@lavalldesign)

    Example!!!!

    function restringir_tipos_de_archivo($mime_types){
    $mime_types = array(
    ‘jpg|jpeg|jpe’ => ‘image/jpeg’,
    ‘gif’ => ‘image/gif’,
    ‘png’ => ‘image/png’,
    ‘pdf’ => ‘application/pdf’
    );
    return $mime_types;
    }
    add_filter(‘upload_mimes’, ‘restringir_tipos_de_archivo’);

Viewing 1 replies (of 1 total)
  • The topic ‘file type restriction’ is closed to new replies.