Discussions

Expand all | Collapse all

How can i restrict file types for attachments?

  • 1.  How can i restrict file types for attachments?

    Posted 03-01-2013 21:02


  • 2.  RE: How can i restrict file types for attachments?

    Posted 03-04-2013 20:14
    Hi Ismail,

    I am sorry, but at this time it's not possible to configure a file attachment field so that only certain types of files are allowed. This is a great suggestion though, and I recommend you submit it to our User Voice site here:

    https://quickbase.uservoice.com

    This will give the community an opportunity to vote on your suggestion and help our Product Managers evaluate which features are most requested by our customers.

    Thanks!
    Jeff


  • 3.  RE: How can i restrict file types for attachments?

    Posted 03-04-2013 20:16
    Thanks for the reply Jeff! I'll  make sure to submit this shortly.


  • 4.  RE: How can i restrict file types for attachments?

    Posted 03-05-2013 03:40
    Hi - while there is no native feature for this, there is a fairly straight forward, simple and creative solution.

    1) Setup a Formula-Text field. Something like this formula would work fine:
    var text file = ToText([Attachment]); //convert the name of the file attachment to textvar text extension = Right($file,"."); //parse apart the file attachment text so we get the extension (all characters after the last period)$extension //show the extension
    * Replace [Attachment] with the name of your field.
    * I use variables here just because I find them cleaner to illustrate the logic. Certainly one long text string would work fine.

    2) Setup a Formula-Checkbox field which will contain the logic for your file extensions:
    If( Contains([Description],"PDF") or Contains([Description],"PNG"), true, false)

    3) Set a form rule to prevent the save when this box = false.

    A few notes:
    * You could do this all in one field quite easily. I just like this approach because it is kind of like "showing your work" and allows you to quickly debug if necessary.
    * The reverse could easily be done to only prevent the save when the box is checked, if you wanted to explicitly deny some document types as opposed to this approach which only allows two choices.

    Let me know if you need any help!



  • 5.  RE: How can i restrict file types for attachments?

     
    Posted 04-11-2018 17:09
    The formula required some adjustments, but works.  However, the rule to prevent the save is not triggering, and still allows ANY file type to be saved.  Is this a Quickbase bug?


  • 6.  RE: How can i restrict file types for attachments?

    Posted 04-11-2018 18:52
    Hi Dan,

    Can you please tell me which file type you want to restrict?

    I have another solution for you.

    Thanks,

    Gaurav


  • 7.  RE: How can i restrict file types for attachments?

     
    Posted 04-11-2018 19:25
    We need to restrict .bat, .exe, .wav  more specifically, we want to restrict the files to pdf, jpg, and gif only.

    Thanks,
    Dan


  • 8.  RE: How can i restrict file types for attachments?

    Posted 04-11-2018 21:59
    Dan,
    A Native solution is to sign up for early access to Automations or wait for the May General Availability release.

    Then set up an Automation to based on a formula field detecting that the suffix of the file is invalid and delete the record.  So it will upload and get deleted immediately.