More in this section

Forums / Developing with Sitefinity / How to restrict "Documents & Files" to upload only certain file types?

How to restrict "Documents & Files" to upload only certain file types?

5 posts, 0 answered
  1. gopalraman gopal
    gopalraman gopal avatar
    52 posts
    Registered:
    03 Dec 2009
    13 Apr 2012
    Link to this post
    Hi,

    I have a couple of question in "Documents & Files" manager

    1-) I need to upload only "jpeg,png,docx and pdf" files to "Documents & Files" from sitefinity 4.4. Can we able to restrict it?

    2-) What are the files types the default "Documents & Files" manager will accept?

    Thanks




  2. Andrei
    Andrei avatar
    553 posts
    Registered:
    27 Nov 2008
    13 Apr 2012
    Link to this post
    Hi, did you try specifying some file extensions as per teh attached image? not sure if you need the '.' or not. whether it is "PDF,DOCX,etc" or ".PDF,.DOCX,.etc". Play around and see. Hope it helps.
    Andrei
    Here is teh image too, attcahed.
  3. Andrei
    Andrei avatar
    553 posts
    Registered:
    27 Nov 2008
    13 Apr 2012
    Link to this post
    also, below is a boolean flag that you need to set to true if you want your filter to be enabled.
  4. gopalraman gopal
    gopalraman gopal avatar
    52 posts
    Registered:
    03 Dec 2009
    16 Apr 2012
    Link to this post
    Hi Andrei ,

    Thanks for your reply.

    I tried pdf and doc files types in different ways as follows,
    1-) doc,pdf
    2-) .doc,.pdf
    3-) DOC,PDF
    4-) .DOC,.PDF

    But still it is not working and i can able to upload "txt" file also after the changes done.
    Is there any other settings i need to do? Please help me over this.

    Thanks
  5. Andrei
    Andrei avatar
    553 posts
    Registered:
    27 Nov 2008
    16 Apr 2012
    Link to this post
    If it doesn't work then it definitely is a bug, but before we assume that:
    1 - Have you enabled the filter (that is the text field below) by setting it to "true"?
    2 - Once you have specified a filter, have you restarted the application from the IIS?
    3 - Before restarting the application from the IIS, have you deleted all the cookies and the browser history?
    You can even re-save the Web.config which will also ensure that the WebApplication will refresh all its caches.
    Do all that for each combination of file extensions, and if it does not work, then it has to be a bug.

    I will say this about Sitefinity, those help prompts under the text fields are a bit useless if they don't have an example of the format that the text entered has to be like. Since you can have comma separated elephants, it would help to see the pattern.

    Thanks,
    Andrei
5 posts, 0 answered