• Resolved IanErickson

    (@ianerickson)


    Hello, I am having a little trouble uploading a file to the media library. Also, it is important that customers be able to upload .ai files during the product ordering process. Customers will upload .ai files and we print them on their products.
    Here is the validation that I copied from the test tool.

    VALIDATION:
      Naive Name: 13PPI2523B 1up Print Template.ai
      Naive Extension: 
      Naive Type: 
      Magic Type: application/pdf
      Best Type: application/postscript
    
    FINAL:
      Name: 13PPI2523B 1up Print Template.ai
      Extension: 
      Type: 
      Code: 32
    
    SYSTEM:
      Kernel: Linux whm2.jonrodman.com 3.10.0-862.el7.x86_64 #1 SMP Fri Apr 20 16:44:24 UTC 2018 x86_64
      PHP: 7.3.28
      Modules: Core; PDO; Phar; Reflection; SPL; SimpleXML; Zend OPcache; bcmath; calendar; ctype; curl; date; dom; exif; fileinfo; filter; ftp; gd; gmp; hash; i360; iconv; imap; json; libxml; litespeed; mbstring; memcached; mysqli; mysqlnd; openssl; pcre; pdo_mysql; pdo_sqlite; posix; session; soap; sockets; sqlite3; standard; timezonedb; tokenizer; wddx; xml; xmlreader; xmlwriter; xsl; zip; zlib
      WordPress: 5.8
      Plugins: classic-editor [1.6.2]; easy-wp-smtp [1.4.7]; ga-google-analytics [20210719]; js_composer [6.7.0]; litespeed-cache [4.3]; ninja-forms [3.5.7]; ninja-forms-addon-manager [3.0.13]; ninja-forms-layout-styles [3.0.29]; ninja-forms-uploads [3.3.12]; ninja-tables [4.1.6]; revslider [6.5.7]; ultimate_vc [3.19.11]; ups-woocommerce-shipping [4.2.6]; woocommerce [5.6.0]; woocommerce-admin [2.5.1]; woocommerce-conditional-shipping-and-payments [1.9.5]; woocommerce-google-analytics-integration [1.5.2]; woocommerce-product-image-gallery-options [1.1.0]; woocommerce-securesubmit-gateway [1.13.0]; woocommerce-tm-extra-product-options [5.1]; wordpress-seo [16.9]; wordpress-seo-premium [16.9]; yikes-inc-easy-custom-woocommerce-product-tabs [1.7.7]
      Theme: Pro-ChildTheme [2.1.6.1531330634]
Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter IanErickson

    (@ianerickson)

    I forgot to include a link to the site. https://subtleimpressions.com/product/bottle-carrier-6-pack/

    Plugin Author Blobfolio

    (@blobfolio)

    Hi @ianerickson!

    By default, WordPress only allows certain file types to be uploaded. Some Adobe formats work out of the box, but Illustrator documents do not. (Lord of the Files does not override these particular settings.)

    But the defaults can be changed!

    It looks like your site already has a “child theme” set up, which makes it pretty easy. Just drop the following code into the child theme’s functions.php file:

    
    // Allow Adobe Illustrator Uploads.
    function allow_ai_uploads($mimes) {
    	$mimes['ai'] = 'application/postscript';
    	return $mimes;
    }
    add_filter('upload_mimes', 'allow_ai_uploads');
    

    If you’d rather not make code changes, there are some third-party plugins (not ours) that can help, like WP Add Mime Types. If you go this route, just remember to set the MIME type as application/postscript, same as the code sample.

    Either approach should do the trick, but please let me know if you run into any issues.

    Thread Starter IanErickson

    (@ianerickson)

    That works just fine. Thanks for the help!

    Plugin Author Blobfolio

    (@blobfolio)

    Perfect!

    I’m gonna go ahead and close out this ticket, but please don’t hesitate to reach back out the next time file weirdness strikes.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Uploading an .ai file to Media Library in multi-site WooCommerce’ is closed to new replies.