how to limit uploaded file types in nuxeo platform - nuxeo

My question is about the nuxeo platform, i want to limit the uploded file types to jpg and png images only. I googled and searched the documentation and found nothing. is there a way to do this?
Thanks

If you're using WebUI, the upload providers support an "accept" attribute, where the value is a comma-separated list of accepted mime types.
https://doc.nuxeo.com/nxdoc/web-ui-upload-providers/
Here's an example:
<nuxeo-dropzone role="widget"
label="PDF file"
name="content"
accept="application/pdf"
document="[[document]]"></nuxeo-dropzone>
Note, the Dropzone component isn't very good at reporting errors back to the user. It fails silently if you upload a type that's not accepted.

Related

Is there a way to upload files without a file extension suffix to Flask-Dropzone?

I'm trying to use Flask-Dropzone as part of a web-app to upload files for processing. These files typically don't have a file extension due to a quirk of the export process that generates these files.
I've consulted both the Flask-Dropzone docs and the Dropzone.js docs and both seem to imply that if DROPZONE_ALLOWED_FILE_CUSTOM = False then every upload of all file types should be accepted. However, when navigating the file upload window, the filter defaults to "All Supported Types" and seems to only accept images. I can toggle this to "All Files" but when trying to upload anything else the dropzone gives the default error message about the file not being allowed.
I am able to set custom allowed file types such as .pdf's, .xlsx, etc. However this isn't useful as the files in question doesn't have a declared file type extension.

Acumatica - Attachments File Extension Filter

Good Day!
I am uploading some files in form as attachments and I am trying to filter the uploaded file extensions. But I am not getting the exact solution for this.
Is there any way to filter the extensions of the files being uploaded in file attachments?
Thank you so much for the help.
If you mean blocking file upload based on the extension you can do so in File Upload Preference Screen (SM202550):
If you mean the filter for the native open file dialog. It seems hardcoded for a handful of common web files and I don't think it can be changed easily.
If you mean the file upload dialog grid, unlike most grids in the system it is not filterable through the column headers:
Maybe the Search in Files page (SM202520) is what you're looking for. You can search files based on extension here:

File of custom type are not searchable in Alfresco using Advance search

I am seeing below behavior in Alfresco and read lots of relates doumentaion of alfresco but not found any clear answer.
Below are things I have done to search a file.
1. Uploaded a file named "Test.txt" in a folder having only one rule to have custom type on the uploaded docs.
2. And when I select content in "look for" option in advance search then my test file comes in result of search.
as shown below.
Then I have searched it using advance search using name property and selecting my custom type in the "look for" option in advance search then it result 0 files.
But when I set any property of test.txt file it becomes searchable using custom type in Advance search.
My question is If I just upload a file. How can it become searchable using custom type in Advance search.?
When is the indexing generated of files uploaded of custom type.
I am using Alfresco 4.1 and Solr as search engine.
Thanks,
Fouad
SOLR indexes Alfresco every 15 seconds by default, so there's no reason why your uploaded file wouldn't be indexed right away.
Are you sure your rule actually works?
I'd suggest taking the file's nodeRef, and using Node Browser to look at it's type, aspects and properties right after it enters the folder (and triggers the rule), and after you change something by hand. That might clear something up, as in why it works/does not work.
Additionally, you could search for unindexed nodes and see if your file is there:
http://docs.alfresco.com/5.0/concepts/solr-index-fix.html

Azure Logic Apps: Check for file type

I setup an Azure Logic App that checks for newly created files in a OneDrive folder and then sends these (images) to the MS Vision API for tagging. This flow works fine.
How can I setup a condition to only react on a specific file type (images) or even better only when the file has a certain file ending, like ".jpg", ".png" etc.?
I tried to setup a condition on the "File content type" but couldn't figure out the appropriate value for the condition ("image" doesn't work).
I couldn't find any hints on the webs and neither on SO. Any help is very much appreciated.
When reading file attachments using the GMail action, I had to use starts with because the Content-Type property contained the MIME type followed by the file name.
The following example is for checking if the file is an Excel file (.xlsx, not .xls):
I also used http://mime.ritey.com/ to upload my files and ensure I had the MIME type correct.
File name is part of the metadata provided by the OneDrive Connector.
Using that, you can apply conditions/filters based on the extension. File content type is probably pretty reliable but in practice, the extension might be better.
I think I found a solution. I was able to kind of reverse engineer the file types by setting up an app that is triggered by new files and writes the file content type to a text file in a different folder.
image/jpg and image/png are image files
application/x-zip-compressed is a zipped file
So it seems that Azure uses standard MIME types to identify the file type (which very much makes sense... :0)

What is the difference between: image/x-citrix-pjpeg and image/pjpeg

Some files are uploaded with a reported MIME type:
image/x-citrix-pjpeg
They are valid jpeg files and I accept them as such.
I was wondering however: why is the MIME type different?
Is there any difference in the format? or was this mimetype invented by some light bulb at citrix for no apparent reason?
Update:
Ok, I did some more searching and testing on this question, and it turns out they're all lying about MIME-type (never trust any info send by the client, I know).
I've checked a bunch of files with different encodings (created with libjpeg)
Official MIME type for jpeg files: image/jpeg
But some applications (most notably MS Internet Explores but also Yahoo! mail) send jpeg files as image/pjpeg
I thought I knew that pjpeg stood for 'progressive' jpeg. It turns out that progressive/standard encoding has nothing to do with it.
MS Internet explorer send out all jpeg files as pjpeg regardless of the contents of the file.
The same goes for citrix: all jpeg files send from a citrix client are reported as the image/x-citrix-pjpeg MIME type.
The files themselves are untouched (identical before and after upload). So it turns out that difference in MIME type is only an indication the software used to send the file?
Why would people invent a new MIME type if there is no differences to the file contents?
image/x-citrix-pjpeg seems to be the MIME type sent by images which are exported from a Citrix session.
I haven't come across any format differences between them and regular JPEGs - most image conversion utilities will handle them the same as a regular pjpeg, once the appropriate mime-type rule is added.
It's possible that in a Citrix session there is some internal magic done when managing jpegs which led them to create this mime-type, which they leave on the file when it's exported from their systems, but that's only my guess. As I say, I haven't noticed any actual format differences from the occasional files in this format we receive.
The closest i have come to find out what this is, is this thread. Hope it helps.
http://forums.citrix.com/message.jspa?messageID=713174
For some reason, when people are running Internet Explorer via Citrix, it changes the mime type for GIF and JPG files.
JPG: image/x-citrix-pjpeg
GIF: image/x-citrix-gif
Based on my testing, PNG files are not affected. I don't know if this is an Internet Explorer issue or Citrix.
It's to do with a feature of Citrix called SpeedBrowse, which intercepts jpegs and gifs in webpages on the [Citrix] server side, so that it can send them whole via ICA (the Citrix remoting protocol) -- this is more efficient than screen-scraping them. As a previous poster suggested, this is implemented by marking the images with a changed mime type.
IIRC it hooks FindMimeFromData in IE to change the mime type on the fly, but this is being applied to uploaded files as well as downloaded ones - surely a bug.
From what I recall the Progressive JPG format is the one that would allow the image to be shown with progressively higher resolution as the download of the file progressed. I am not entirely aware of the details, but if you remember back in the days of dial up, some files would show blurry, then better and eventually complete as they were downloaded. For this to work the data needs to be sent in a different order than a JPEG would typically be sent.
The actual data, once you view it, is identical it is just sent in a different order. The JPEG encoding itself may very well group pixels differently, I forget.

Resources