locked
How to filter the values based on the type of repository? RRS feed

  • Question

  • Hi,

    I want to do something like this :

    a) If we have a Picture library ,and when clicked on upload picture->browse : it shows all items like document,files with every extension.I need to show only images when clicked on browse

    Is it possible?

    Means in picture library i dont want to show users, documents also when clicked on browse ..

    Any links and tutorials will be helpfull.

    thanx in advance :)


    "The Only Way To Get Smarter Is By Playing A Smarter Opponent"
    Monday, August 29, 2011 6:29 AM

All replies

  • You need to change the source parameter in your querystring. That is pointing you to a certain page after you have done something. Normally, this points you to the default view on your library.

    You say you have a picture library but it also contains documents and other stuff ? Why don't you just put pictures there and all the documents in a separate document library ?

    If you just want to show pictures, you could also change the default view into something that only shows those: do a filter on a Content Type or some other field that is unique to pictures.

     


    Regards, Marijn Somers|| http://www.beyond-it.be || Twitter: http://twitter.com/marijnsomers || http://marijnsomers.blogspot.com
    Monday, August 29, 2011 6:57 AM
  • Hi MarijnSomers,

    Actualy when i click on browse button it pop up the windows pop up block which contains all files.In that pop up block i want to show only pictures in it.

    Means by default it is set to the "*.*",i want to point it by default to Picture(*.gip,*.jpeg) .

     


    "The Only Way To Get Smarter Is By Playing A Smarter Opponent"
    Monday, August 29, 2011 8:19 AM
  • Ah, you mean the standard windows browse functionality ? I guess you could better ask that in the programming section of this blog, there is no out-of--the-box way to do that.


    Regards, Marijn Somers|| http://www.beyond-it.be || Twitter: http://twitter.com/marijnsomers || http://marijnsomers.blogspot.com
    Monday, August 29, 2011 1:54 PM
  • The browse buttom is implemented by HTML tag <Input type="file"/> (http://www.w3schools.com/tags/att_input_type.asp). I find no parameter to restrict the file type. End user can change the file type filter to Pictures easily on the Windows file open dialogue. Just one more click.

    Or, you can use upload multiple pictures, which calls the Office Picture Manager.

    Tuesday, August 30, 2011 9:16 AM
  • Hi GuYuming,

    Thanx for your reply.

    But i dont want to add a extra step for the user.I want to restrict it.

    Thier is no other way to do it in any of .aspx pages from where the windows file open dialog is been called?


    "The Only Way To Get Smarter Is By Playing A Smarter Opponent"
    Tuesday, September 6, 2011 11:04 AM
  • Ravi,

    If you want to restrict that, i guess have a few options:

    - write your custom OFD / use a 3d party OFD

    - easier: via jquery you could get the filetype of the selected document and you can give a error


    Regards, Marijn Somers|| http://www.beyond-it.be || Twitter: http://twitter.com/marijnsomers || http://marijnsomers.blogspot.com
    Tuesday, September 6, 2011 1:29 PM