Custom Fields
Support General allow File field to upload .json to specific directory

  • Creator
  • #19475
    Resolved rubbergumball

    I've working on a post meta that I need to upload a .json file to a specific directory under wp-content. In my testing I see that I can upload PDF or image files, but not .json.

    I've added a mime types filter - but the file is still not uploading.

    add_filter( 'upload_mimes', 'my_myme_types', 1, 1 );
    function my_myme_types( $mime_types ) {
      $mime_types['json'] = 'application/json'; // Adding .json extension
      return $mime_types;

    Thank you.

Viewing 1 replies (of 1 total)
  • Author
  • #19484
    Long Nguyen


    Please add this code define( 'ALLOW_UNFILTERED_UPLOADS', true ); to the file wp-config.php and should before the line /* That's all, stop editing! Happy publishing. */ then upload the file .json again.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.