Opening swf in flash player from javascript - javascript

I have a project developed with flex, in which reports are generated as SWF files. My requirement is that when I click an html button on my page, that SWF file should be opened with flash player installed within my system. How can I achieve the same if I want to do with javascript?

If you link directly to the SWF file the browser will attempt to open it. In order to be able to choose if you want to save/open the file in external application you need to alter the HTTP headers - which means some serverside scripting

Related

Open Files in Browser instead of downloading (including files like .doc, .xls etc)

I am using Java Rest APIs to upload files in my project. Based on the configuration my files either goes into s3 bucket, google drive, one drive or even in local file system (in the same machine where my application is running). During download again I am making an ajax call which returns the file in response with Content Disposition header attachment; and browser downloads the file irrespective of its format. I want an option to view these files in the browser instead of downloading it directly. How can I do that ? (Especially formats like doc,xls etc)
As far as I know, there are no client-side libraries exist that can open .doc, .docs, .xls in browser. There is a way to render render your files using browser is to use Google Documents' Viewer or Microsoft Office 365 viewer via an <iframe>. Using this inside an <iframe> you can open your file in side your browser but can not edit.
Google Documents' Viewer inside <iframe>
<iframe src="http://docs.google.com/gview?url=http://example.com/path/to/your/document.doc&embedded=true"></iframe>
Google Documents' Viewer clickable link <a>
Open your doc file
Microsoft Office 365 viewer <iframe>
<iframe src='https://view.officeapps.live.com/op/embed.aspx?src=http://example.com/path/to/your/document.doc' width='1366px' height='623px' frameborder='0'></iframe>
Browsers don't have any built-in way to view Word docs so unless the user has configured their browser to open it with some plugin (which 99% of the world hasn't done), the browser will prompt them to download the file.
However, if you only need to display the Word Document, but don't need to edit it, you can use Google Documents' Viewer via an to display a remotely hosted .doc/.docx.
<iframe src="http://docs.google.com/gview?url=http://url-of-the-file&embedded=true"></iframe>
you can generate temporary URL for your s3 documents by keeping them private.
if you are interested in giving users privilege to edit them online then you can go with any tool like onlyoffice

Open file linked to href in windows application using Javascript

I created HTML5 web page that has an href link, this is linked to a file in the SQL server. I need a solution to open the linked file in a windows application like Image viewer, MS Word etc..or pop up an "Open with" window to choose the application I want to open the file. I want to implement this functionality in Javascript.

Copy local file to another location with a web page

I do not know if this is possible to do.
What I want to achieve is a web page (online) where once you select an image from my pc via a classical input in html, let me copy it to another folder always inside of my PC (or a PC connected to the network local).
I can do this thing? Maybe with javascript?
There are other possible solutions?
Thanks.
You cannot do this. Websites have no permission to access Your computer local system. With HTML <input type="file"> You can only send files to the chosen website directory. Eventually, You can download those files later and put them on the other place in Your system.

How to disable pdf file download option using JQuery?

How to disable pdf download using jquery or javascript.
In my website I am loading some pdf files in iframe. I need to protect my files.
So how can I dissable pdf file download, print those kind of options.
Please help me.
My website created using html. jquery, mysql and php
Since you are delivering pdf file directly into the browser, displayed using Adobe Reader ActiveX, how can it be possible to prevent file download, since the files are displayed after downloaded into your temp directory?
So it is not possible using ANY JavaScript library.
The only way to secure your master PDF files is by creating Images for each page and present those to the user on the web via your own interface (html, flash etc).
You may use ImageMagick along with GhostScript for this.
You may go through www.veryinteractivepeople.com/?p=521
Hope this helps...:)

"open" modify and "save as" files to and from javascript / flash / silverlight or java in a web browser, Without uploading to server?

What is the best way to have a file 'browse' dialog pop up and a user 'uploads' a file that I can retrieve in Javascript without uploading the file to a server just to download it back to the client in Javascript?
I found Downloadify for letting users 'download' a javascript generated file without bouncing off a server: https://github.com/dcneiner/Downloadify
is there a way to 'uploadify' a file the user browses to and opens and get it into Javascript in a data:url or some form without bouncing it off the server 100% client-side?
The ability to "open" a file the user selects from their hard drive, edit it in javascript and "save as" back out to the user's hard drive without any server-side code?
I am making a back-office so it doesn't need to be cross-browser if it's sported in google chrome, ideally in Javascript/HTML5, but flash or silverlight could work too, hopefully not java.
Silverlight lets you do that with the OpenFileDialog class. I am currently working on a Silverlight project and I exclusively use Chrome so you shouldn't have any problems in that environment.
Flash has support for reading and writing local files:
http://www.mikechambers.com/blog/2008/08/20/reading-and-writing-local-files-in-flash-player-10/
For sending data between Flash and JavaScript, you can use the ExternalInterface API:
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/external/ExternalInterface.html

Categories

Resources