cancel
Showing results for 
Search instead for 
Did you mean: 

How to configure file upload restriction by file extension?

Former Member
0 Kudos

Hi All,

I want to know if its possible to restrict the file upload for any file extensions in CM Repositories. For example, I want that the users can not upload .avi files. Can I configure that restriction?

Regards and Thanks,

Arnau Rovira

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Thanks.

What is better? Modify the upload command or implement Repository Service?

How can I do that in both cases?

Former Member
0 Kudos

Hi!

Quotas that are not controlled by the repository manager itself most probably will be insecure (there will be ways to bypass the limits) and slow. If acceptible performance is gained by counting bytes and persisting their numbers somewhere inconsistencies might occur.

Just to make you aware of possible problems

bye, Dirk

detlev_beutner
Active Contributor
0 Kudos

Hi Arnau, hi Dirk,

Dirk - you mixed up the threads - here we are talking about the file extension, the quota thread is a different

Arnau - implementing a repository service is somewhat more "simple", at least it would be a solution which is a supported extension within the framework. On the other hand, as discussed in one of the other threads, for user friendlyness, you will want to have some UI response for the user that this upload is not allowed. For this, you will need to touch the upload command anyhow. So modifying it or implementing your own command probably would be somewhat "better".

Hope it helps

Detlev

Former Member
0 Kudos

Oops, you are right, sorry!

Former Member
0 Kudos

Thanks to all.

How can I create a repository service? It's like a web service?

In the other side, can I copy the upload command from the actual repository service to my new repository service? I hope that I don't have to create new upload command from zero...

What I have to do to create this new upload command?

Thanks in advance.

detlev_beutner
Active Contributor
0 Kudos

Hi,

> How can I create a repository service?

> It's like a web service?

No. A repository service is a standard pluggable service within the KM framework. Search for "repository service" on SDN for further details.

> can I copy the upload command

> from the actual repository service

The upload command is the upload command is the upload command. It is not bound to any repository service.

Yes, you can try to extract all implementation classes for the actual upload command and create a new one under a new namespace and modify the interesting parts after decompilation. But be warned: Your questions signal that you are a beginner in the KM framework, and the things described so far are more in the direction "hardcore development"...

Hope it helps nevertheless

Detlev

Answers (2)

Answers (2)

detlev_beutner
Active Contributor
0 Kudos

Hi Arnau, hi Dirk,

same answer as in and in - can be done by an own implementation or a modification of a/the upload command or by implementing a repository service (Dirk: not filter, that would allow the existence of the file) reacting on resource creation.

Hope it helps

Detlev

PS: Arnau, please consider rewarding points for helpful answers on SDN. Thanks in advance!

Former Member
0 Kudos

Hi!

Unfortunately this is not possible with standard functionality.

If you want to develop your own solution (e.g. by using a repository filter) be aware, that users will try to avoid the restriction by renaming the files after upload.

bye, Dirk