Handling zip files via media browser - drupal-7

I am using media module with wysiwyg integration of media browser.
I need to create a new file type (say zip) and have custom formatters for this file type. So, whenever a zip file is uploaded via media browser, i want it to get associated with "zip" file type and the formatters should be applied to it as selected by the user.
Tried to look for some tutorials but not much of help. Can someone please guide me through with this?
Thanks.

Related

Embedded Document Viewer control in ReactJS

We are creating a search frontend using ReactJS. The requirement is that when a user clicks on a document's name, the document has to open in an embedded viewer. Has anyone used any ReactJS component for this? Otherwise, should I use a JQuery viewer component? Please advice. Thanks in advance.
'react-file-viewer' can do the job done. it supports a wide variety of file formats including .docx format but fails miserably for .doc extension. correct me if i'm wrong, i couldn't find a component which can handle .doc file extension. finally solved with google api for doc viewer. i recommend to use it only to handle doc and docx file extensions. then go for comparitavely small libraries such as react-pdf to handle pdf extension.
you can render your doc, docx file types with in using google api
<iframe class={filetype} width="830" height="400" frameborder="0" src={`https://docs.google.com/gview?url=${file_url}&embedded=true`}></iframe>

Converting Blob object to html in google app

I have stored user uploaded document (.doc ,.pdf) as a Blob object into data-store.
Instead of allowing user to download the document, I would like to present it as an HTML page
for viewing the doc. how do I convert Blob into HTML ? does google app engine provides any ready made API for the same?
There is no ready made API in AppEngine to convert .doc or .pdf (or or other types of) files to HTML. You would need to find a library for your preferred language to parse the blob file into its parts structured as an object model (like a DOM). Then you would need to write code to convert individual parts of the object model to HTML, unless you are lucky enough to find another library. And no, StackOverflow is not a good place to ask "what library is there...".
No. AppEngine itself does not provide any file format conversion tools. You might want to look into Google Drive API, which might, to some extent, do the format conversion for you.
You can have embed a PDF reader on a web page by using pdf.js.
Most browsers already have a built-in PDF viewer. If you provide a link to a PDF file, when users click on it, many browsers will automatically display the document. Those browsers that do not support this option, will offer a user to download the file to their hard-drive.
This is the easiest solution - you don't have to do anything at all.

How to manipulate attachement path on DotNetNuke.UI.UserControls.TextEditor

Im kinda new to DNN and I need to control the text editor not to show the system files when users attach files to a mini blog. Is there a way to manipulate the DotNetNuke.UI.UserControls.TextEditor attachment path to look only on a specified folder and not defaulting to ~/portal/[portalid]?
Thanks in advance!
Cheers
In the Host/ HTML Configuration Manager page you can choose the "Path" that the Text Editor loads by default (found under the Image Manager Settings section)
You can also make those settings apply only to a specific page or role if necessary

How to change attachment MIME type

I'm using XPages FileUpload control to save some attachments (.xml files) to the document.
By default Domino is saving .xml with "text/xml" MIME type. However I need it to be "application/xml".
Setting FileUpload control "MIME type" option does not help as Domino recognizes file type and changes it.
Is there a way to accomplish this task and manually switch attachment MIME type to a custom one?
You might want to look at "the other end". Instead of trying to alter the mime-type when saving (Which I actually doubt Domino does save!!!), change the way the file is served when retrieved. Instead of using the build in URL to access it, use an XAgent. There you can set the MIME-Type header to your hearts desire.
Edit:
The sneaky way: Don't do anything in your application. Talk to your admin. In the website configuration you can specify rules. Provide the pattern for the XML file and overwrite the mime-type header in the configuration. The admin documentation has all the details. You want to use the "custom header"

How Can I get the raw URL of the uploaded media file?

I have a media field through which I both embed video files from Youtube and upload videos to. I do only want to get the raw URL of the uploaded/embedded videos through the views module but I can't manage it. There are predefined formatters for the video field in the view UI, however the link formatter prints additional data that I don't need. How can I get the raw URL only?
Thanks!
The module below lets you manipulate the view using php.
http://drupal.org/project/views_php

Resources