Prevent TIF file upload to graphic dials - xmpie-users/uStore-js GitHub Wiki

uStore customization step includes the Gallery Image Selector that allows customers to upload .EPS, .EPSF, .JPG, .JPEG, .TIFF, .TIF, and .PDF file types.

In some cases you may want to restrict the user from uploading a particular graphic file type.

This JavaScript provides an example that prevents the user from uploading a .TIF file. You can modify for other file types as necessary:

<script type="text/javascript"> 
var myDialId = 10342; //change this to your graphic dial id
var lastValue = ''; 
$(document).ready(function() { 
  window.setInterval(function() { 
    if(lastValue == '' || lastValue != $("#previewBig_"+myDialId).attr("fileextension")) { 
      lastValue = $("#previewBig_"+myDialId).attr("fileextension"); 
      if(lastValue == '.TIF') { 
        alert('TIF File Types are not allowed on this product.'); 
      } 
    } 
  }, 500); 
}); 
</script> 

For information on how to add JavaScript to your store: How to add JavaScript to a storefront.

⚠️ **GitHub.com Fallback** ⚠️