Adding filters for extensions.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2013 12:55 AM
In /share/components/upload folder, we are having some js files like dnd-upload.js, file-upload.js, flash-upload.js, html-upload.js. I can see one line in file-upload.js like;
I modified file-upload.js and html-upload.js files.
Modified files are attaching with this.
But this didnt block uploading image files.
How can I block uploading files by adding extensions into the filter?
<filter: {array}, // limits what kind of files the user can select in the OS file selector
I modified file-upload.js and html-upload.js files.
Modified files are attaching with this.
But this didnt block uploading image files.
How can I block uploading files by adding extensions into the filter?
Labels:
- Labels:
-
Archive
html-upload.txt.zip
6 KB
file-upload.txt.zip
4 KB
8 REPLIES 8

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2013 03:04 AM
I am not sure what this filter does exactly.
But logically once you upload a file then alfresco detects its mimetype so its late to restrict specific mimetype.
You may develop custom rule to delete content of specific mimetype or can develop behavior which implements NodeService Policy, Specifically onCreateNode.
But logically once you upload a file then alfresco detects its mimetype so its late to restrict specific mimetype.
You may develop custom rule to delete content of specific mimetype or can develop behavior which implements NodeService Policy, Specifically onCreateNode.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2013 03:55 AM
I hope that the filter will block the files on upload.
There is a commented line in all upload js files like;
I can execute a script with the rule for deleting some mime types.
The problem is , if I am deleting exe files with a check like ;
this will not allow to create folder also, becz folder also will be deleted on creation. That is a big problem. Is there any way to solve it?
OR
How can I create a rule to delete files with specific extensions?
There is a commented line in all upload js files like;
filter: {array}, // limits what kind of files the user can select in the OS file selector
I can execute a script with the rule for deleting some mime types.
The problem is , if I am deleting exe files with a check like ;
if(document.mimetype == "application/octet-stream"){ document.remove();}
this will not allow to create folder also, becz folder also will be deleted on creation. That is a big problem. Is there any way to solve it?
OR
How can I create a rule to delete files with specific extensions?

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2013 05:27 AM
Sorry , I am not sure but I dont get this, your script also deleted the folder.
Your script looks OK and "docuement" object that also refers to content.
You have applied this rule specifically for "cm:content" or for "All Items".
If you have not defined any condition while applying rule then can you please try with cm:content! This script should work as expected - It should not delete folder
Your script looks OK and "docuement" object that also refers to content.
You have applied this rule specifically for "cm:content" or for "All Items".
If you have not defined any condition while applying rule then can you please try with cm:content! This script should work as expected - It should not delete folder
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2013 05:43 AM
It worked. It was for "All Items". Changed for "cm:content".
Is there any way to delete from Trashcan also? I dont want to keep it any trashcan too.
Is there any way to delete from Trashcan also? I dont want to keep it any trashcan too.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2013 02:47 AM
Hi Shibu,
In the same scrip add temporary aspect. document.addAspect("sys:temporary). It will directly delete the file without moving it to trashcan. Hope it helps
In the same scrip add temporary aspect. document.addAspect("sys:temporary). It will directly delete the file without moving it to trashcan. Hope it helps
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2013 01:20 AM
It worked fine…
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2013 04:23 AM
Check out this discussion on StackOverflow : http://stackoverflow.com/questions/13905434/alfresco-share-file-upload-filter
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2013 01:26 AM
I have checked. Please have a look into the attachments in the first post. I have used the filter discussed in the StackOverflow. But its not working. Please check those attachments once.
