Restrict Alfresco upload to specific file extension (ex: users can only upload PDFs) - alfresco

I want to prevent my Alfresco 5.1 users from uploading anything else than ".pdf" and ".xslx" files.
What is the best way to implement that in Alfresco?
Is there a setting, or do I have to write some Java code?
Filtering must be done on the file extension, regardless of MIME types. The restriction must apply via FTP too.

You can't do this through simple Alfresco configuration. I'd suggest writing a Behaviour that would implement this logic. It will get triggered no matter how something ends up in Alfresco (Share, FTP, custom application, etc).
http://docs.alfresco.com/5.2/references/dev-extension-points-behaviors.html

You can not restrict throught FTP. Some ftp client provide file name filter facility,Using that you can Restrict.In alfresco try to create rule ,on that rule execute script ,that script contain code to delete file which is not allow.

Related

Set Doctype of new upload files using FTP in alfresco

I am using alfresco-5.2.I have enabled the FTP in alfresco,and able to upload the files successfully.but those are coming without type can anyone tell me how to set doctype and metadata for file.
FTP allows you to upload the file and that's about it. Similar to copying via WebDAV or CIFS. If that is your only option you will have to follow Gagravarr's suggestion and add a folder rule to the folder that specializes the type and sets the properties as you see fit (in Share, go to the folder and click "Manage Rules").
If code is an option then you should use CMIS to upload the documents because CMIS will allow you to set the document type and set custom properties. There are CMIS clients for a number of languages including Java, Python, .NET, and others. The most widely-used client libraries can found at the Apache Chemistry project.

Is there a possibility to encrypt media files uploaded in Moodle?

I've run into a problem using Moodle 3.2. I'm uploading mp3-files to be played in a quiz. I have the license to use those files for that specific purpose, but I am not the owner. Thus, I would like to ensure that nobody without a Moodle account can access these files.
However, the path to the files can be extracted from the source code and once you have the path, anybody can access the file. Is there any way to protect the file so only registered users can access it, even if they have the direct path?
Thank you so much!
All the best
Dom
EDIT: I've learned that files actually are encrypted by login - I just had the login cookie remaining in several browsers and thus was able to access them.
Are the files served by moodleinstallation/pluginfile.php/? This would include login/permission checks

User cannot create file using WebDav with Alfresco

I am using WebDav to copy and paste multiple files into Alfresco.
The problem is that I can only do this with administrator IDs.
When I try to create new files or update existing files as a non-administrator
user, I get the following error:
HTTP Status Code: 403 caused by: org.alfresco.repo.security.permissions.AccessDeniedException: 03300303 Access Denied. You do not have the appropriate permissions to perform this operation.
Is there anyway to allow non-administrator IDs to create/update files?
The Alfresco WebDAV support uses identical permissions to the rest of Alfresco. Nothing special - it's just one of the number of different ways you can interact with the nodes stored in your Alfresco repo.
As such, the user you log in as needs to have both read and write permissions to the folder in question. Typically, that means they need to be a member of the site you want to write to, and need to have permissions higher than Consumer.
As long as the user has write permissions to where you want to write to, they'll be able to make changes using WebDAV.

How to execute custom Alfresco script on saving document opened via WebDAV or CIFS?

I want to open an Excel file to edit offline via WebDAV or CIFS and run my script at the Alfresco side to parse the content of the file when user saves a workbook.
Is it possible? How can I do this?
Use a content rule for inbound/updated documents. This way, regardless of which interface the user leverages to access documents (HTTP/WebDAV/CIFS/FTP) the rule will be triggered, and you can set it to "Execute Script" as an outcome.

How to store Blobs in Drupal?

I want to store PDF and Image files in Drupal. By default Drupal seems to store binary/uploaded files into the filesystem. I want to to be able to store files so that - I can have workflows, metadata, IP information and URL aliases?
Update, am still stuck at how to create URL aliases for files on the file system. Drupal only seems to allow creating URL aliases to node content.
The simplest solution for Drupal is to use the Upload module, which is in core. The upload module allows you attach files to nodes. As you note, they are stored in the filesystem.
If you want to get more complex, you can build your own content types through the web interface by using the CCK family of modules (such as the filefield module or the imagefield module). Your files are still stored on the filesystem.
You could use CCK to create the metadata field you want.
You could use the workflow or rules modules to implement workflow.
IP information is recorded automatically by Drupal's logging module (either the database logging module, which logs to the database, or the syslog module, which logs to syslog).
URL aliases for nodes are available in core Drupal by enabling the path module (or download the pathauto module for automatic creation of aliases).
I tried Drupal's Upload module, FileField as well as uploading files using FCKEditor - I prefer the last one - it is closer to my specific scenario.
Creating an alias to the file will likely require some custom code.
It's not possible to simply create an alias using the Administer > Site building > URL aliases screen. I tried inserting a record with
insert into url_alias (src, dst) values ('sites/default/files/ChipotleArt.JPG', 'here-is-the-file.jpg');
That still didn't work. So, you will really likely need to write some custom code.

Resources