Index: /main/waeup.sirp/trunk/src/waeup/sirp/imagestorage.py
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/imagestorage.py	(revision 7065)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/imagestorage.py	(revision 7066)
@@ -209,10 +209,13 @@
     grok.implements(IFileStoreNameChooser)
 
-    def checkName(self, name):
-        """Check whether an object name is valid.
+    def checkName(self, name, attr=None):
+        """Check whether a given name (file id) is valid.
 
         Raises a user error if the name is not valid.
 
-        For the default file store name chooser any name is valid.
+        For the default file store name chooser any name is valid as
+        long as it is a string.
+
+        The `attr` is not taken into account here.
         """
         if isinstance(name, basestring):
@@ -220,9 +223,9 @@
         return False
 
-    def chooseName(self, name):
-        """Choose a unique valid name for the object.
-
-        The given name and object may be taken into account when
-        choosing the name.
+    def chooseName(self, name, attr=None):
+        """Choose a unique valid file id for the object.
+
+        The given name may be taken into account when choosing the
+        name (file id).
 
         chooseName is expected to always choose a valid name (that
@@ -230,5 +233,6 @@
 
         For this default name chooser we return the given name if it
-        is valid or ``unknown_file`` else.
+        is valid or ``unknown_file`` else. The `attr` param is not
+        taken into account here.
         """
         if self.checkName(name):
Index: /main/waeup.sirp/trunk/src/waeup/sirp/interfaces.py
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/interfaces.py	(revision 7065)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/interfaces.py	(revision 7066)
@@ -600,5 +600,5 @@
     """See zope.container.interfaces.INameChooser for base methods.
     """
-    def checkName(name):
+    def checkName(name, attr=None):
         """Check whether an object name is valid.
 
@@ -606,12 +606,22 @@
         """
 
-    def chooseName(name):
-        """Choose a unique valid name for the object.
-
-        The given name and object may be taken into account when
-        choosing the name.
-
-        chooseName is expected to always choose a valid name (that would pass
-        the checkName test) and never raise an error.
+    def chooseName(name, attr=None):
+        """Choose a unique valid file id for the object.
+
+        The given name may be taken into account when choosing the
+        name (file id).
+
+        chooseName is expected to always choose a valid file id (that
+        would pass the checkName test) and never raise an error.
+
+        If `attr` is not ``None`` it might been taken into account as
+        well when generating the file id. Usual behaviour is to
+        interpret `attr` as a hint for what type of file for a given
+        context should be stored if there are several types
+        possible. For instance for a certain student some file could
+        be the connected passport photograph or some certificate scan
+        or whatever. Each of them has to be stored in a different
+        location so setting `attr` to a sensible value should give
+        different file ids returned.
         """
 
Index: /main/waeup.sirp/trunk/src/waeup/sirp/tests/test_imagestorage.py
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/tests/test_imagestorage.py	(revision 7065)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/tests/test_imagestorage.py	(revision 7066)
@@ -158,5 +158,11 @@
         self.context = context
 
-    def chooseName(self, name=None):
+    def chooseName(self, name=None, attr=None):
+        # this name chooser returns different file ids depending on
+        # the `attr` parameter, a simple string.
+        if attr=='img':
+            return '__mymarker__mysample.jpg'
+        elif attr=='doc':
+            return '__mymarker__mysample.doc'
         return '__mymarker__mysample.txt'
 
