Skip to main content

Is there a way to limit the type of file a user can upload?  I only want PDF files to be allowed…

Maybe a validation rule on the “Content Type” field of the attachment object? 


If memory serves, workflow rules don’t support attachments.  You will probably need Apex here.

Here’s a nice example to get you started: 

http://blog.prasannadeshpande.com/2013/10/salesforce-trigger-on-attachment/.


hmmm… this is apex. Since this is the case, can we put together something more meaty using a visualforce page with a skuid:page visualforce component for all things related to attachments. ie. require an description upon uploading.

Shooting from the hip on this one.


Curious if anyone got a solution working here…and whether you did it with attachments to the object or the lookup field (to the custom skuid file object).


Has anyone come up with a solution for this one?


Maybe this would help: Help And Training Community


I have posted something like this before. 

A solution is Javascript. This prevents the user from picking other filetypes than specified. But this is not foolproof since JS could be disabled in the browser.


$('INPUTTtype="file"]').change(function (event) {<br> var ext = this.value.match(/.(.+)$/))1]; switch (ext) { case 'pdf': break; default: alert('This Filetype is not supported.'); this.value = ''; window.stop(); } });