I could finally solve the problem by adding to 'enablePreviewProviders' array in the config file the following string: 'OC\Preview\TIFF'.
I knew TIFF previews were not displayed with the standard configuration, but I didn't know it would affect fileActions. Maybe the documentation should be improved by explaining this fact. Thanks for your time. 2016-02-04 17:00 GMT+00:00 Héctor Acosta <[email protected]>: > I think the mime type is correctly detected. As I said before, the > getActions function seems to return my custom FileAction when dropdown is > triggered. However, it is not returned on page load. > > Here it is the tr markdown for my example file: > > <tr data-id="181" data-type="file" data-size="1672" > data-file="common_HomeDirectory.tiff" data-mime="image/tiff" > data-mtime="1454591541000" data-etag="4a8d9f8d708eb1383450eb4f54774f0d" > data-permissions="27" class="highlighted"> > > Thanks. > > 2016-02-04 16:54 GMT+00:00 Vincent Petry <[email protected]>: > >> Hello, >> >> First check if the "data-mime" attribute of the "tr" row of the TIFF file >> has the correct mime type. >> >> Maybe the mime type isn't set properly on the server ? >> >> Cheers, >> >> Vincent >> >> >> On 04.02.2016 17:47, Héctor Acosta wrote: >> >> I'm having issues at including custom FileActions in the dropdown list for >> TIFF files. >> >> I'm currently using Owncloud Server 8.2.1. >> >> I've created a custom app that downloads a "low-res" version of an image. >> This option is accesible through the three-dotted dropdown menu of every >> file. It works for other image formats such as JPEG or PNG, except for >> TIFF. I know OwnCloud has some issues with TIFF files for features like >> showing a preview etc. but I don't think this affects my current issue. >> >> I register my action including this piece of code in the js file of my app: >> >> if ( typeof OCA !== 'undefined' >> && typeof OCA.Files !== 'undefined' >> && typeof OCA.Files.fileActions !== 'undefined' >> ) { >> OCA.Files.fileActions.registerAction( >> { >> mime:'image/tiff', >> name:'Download preview', >> displayName:'Download preview', >> order: 2500, >> icon: OC.imagePath('core', 'actions/history'), >> permissions: OC.PERMISSION_READ, >> actionHandler: imagedownloadFileAction.onImageDownload >> } >> ); >> OCA.Files.fileActions.setDefault(mime, 'Download preview'); >> } >> >> When I debug getActions function in apps/files/js/fileactions.js the >> filteredActions variable shows my FileAction, however, it is never added to >> the dropdown list. >> >> As I mentioned before, I have tried with several values for mime in >> registerAction (even with 'image' and 'all') and it always work for every >> image format but for TIFF. I want to be sure it is an issue and not my >> mistake before posting to Github. Any solution/workaround? >> >> >> >> >> _______________________________________________ >> Devel mailing >> [email protected]http://mailman.owncloud.org/mailman/listinfo/devel >> >> >> >> _______________________________________________ >> Devel mailing list >> [email protected] >> http://mailman.owncloud.org/mailman/listinfo/devel >> >> >
_______________________________________________ Devel mailing list [email protected] http://mailman.owncloud.org/mailman/listinfo/devel
