Support

Account

Home Forums ACF PRO File Upload – Allowed file types Not Working

Solving

File Upload – Allowed file types Not Working

  • Hello,

    The Allowed file types in Not Working for the file upload field.

    I have added jpg as the allowed file type and the field is accepting other file types xlsx, rar, png

    ACF Pro Version: Version 5.3.9.2

  • HI @bhargavy

    I’m afraid I couldn’t reproduce this issue on my end. It’s possible that there’s a function on your site that overrides ACF’s validation. Could you please try to reproduce the issue on one of the WordPress’ stock themes (like Twenty Sixteen) with other plugins deactivated? If it disappears, then you can activate the theme and plugins one by one to see which one causes the issue.

    If the issue persists, could you please share the JSON export of your field group so I can test it out on my installation?

    Thanks 🙂

  • Hi @acf-support

    What’s Happening is On selecting a file from the media library or uploading its showing a restricted message but is allowing me to pick the wrong format file and save the same without any error thrown.

    No error thrown on save/update
    After Saving

    Warning shown on wrong file selection
    Warning

    I’m using php code to include the acf fields

    
    				array (
    					'key' => 'field_18',
    					'label' => 'Documents:',
    					'name' => 'documents',
    					'type' => 'file',
    					'instructions' => '',
    					'required' => 1,
    					'conditional_logic' => 0,
    					'wrapper' => array (
    						'width' => 50,
    						'class' => '',
    						'id' => '',
    					),
    					'return_format' => 'url',
    					'library' => 'all',
    					'min_size' => '',
    					'max_size' => '',
    					'mime_types' => 'jpg,jpeg',
    				),
    
  • Hi @bhargavy

    I’m afraid I still couldn’t reproduce this issue. When I choose the wrong format, the select button is disabled. I’ve attached a screenshot for your reference.

    Have you tried to reproduce the issue on one of the WordPress’ stock themes (like Twenty Fifteen) with only ACF activated? Sometimes, WordPress plugins and themes are not coded correctly, and it can cause a conflict between each other. By deactivating them, we will know right away if there’s a conflict on your site or not. If we know which one caused the issue, we can focus on that theme/plugin alone to solve it.

    Thanks 🙂

  • Hi @acf-support

    I did as you asked and the file type validation is working as per your screenshot directly when linked to a post but when it is placed inside a repeater field it’s not working its showing the warning on selection of wrong format file but the select button is not disabled and on file upload of wrong format it’s allowing the file to be uploaded instead of throwing an error.

    ReChecked on clean install on localhost.

  • Hi @bhargavy

    Thanks for trying it out. I can reproduce it on my end now. Could you please submit a new ticket so this issue can be passed directly to the plugin author? You can submit it here: https://support.advancedcustomfields.com/new-ticket. Please don’t forget to explain the issue again or just include the link to this thread.

    Thanks 🙂

  • Created new ticket.

  • Hello, I am having the same issue trying to upload a .doc file.

    Wordpress Version 5.0.3 Multisite
    Files type allowed in the network : jpg jpeg png gif mov avi mpg 3gp 3g2 midi mid pdf doc ppt odt pptx doc docx pps ppsx xls xlsx key mp3 ogg flac m4a wav mp4 m4v webm ogv flv

    ACF PRO 5.7.10 using a file field under a repeater.
    File types allowed in the file field : .pdf,.doc,.docx,.ppt,.pptx,.xls,.xlsx

    I don’t know what is the problem.

    Please advise

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

The topic ‘File Upload – Allowed file types Not Working’ is closed to new replies.