Browser application & local file system access - html

I want to enhance my browser-based web application with functionality that enables management of local files and folders. E.g. folder tree structures should be synchronized between local workstation and server via HTTP(S).
I am aware of security-related limitations in browser-based applications. However, there are some techniques that "work around" these issues:
Signed Java applets (full trust)
.NET Windows Forms browser controls (no joke, that works. Just the configuration is horrible)
ActiveX
My question is: What do you use/suggest, both technology and implementation practice? Key requirement is that the installation process is as simple as possible.
Thanks for your opinions!

Google Gears.
it lets you write Javascript applications with a much bigger platform support than the usual browser, and go 'unconnected' with local file access, cache and DB. and if/when connected it syncs to the central server.
available for several browsers on all platforms; but still under heavy evolution.

Both Gears and Adobe Air require the user to manually select a local file before you get any programmatic access. Very limited because of security considerations when it comes to local filesystem access, so no chance for any web based file sync type functionality there as far as I can see. Maybe I'm wrong about Adobe Air but this is definitely the case with gears. But If I'm wrong let me know!

Silverlight 4 (still in beta) allows file system access:
"Read and write files to the user’s MyDocuments, MyMusic, MyPictures and MyVideos folder (or equivalent for non-windows platforms) for example storage of media files and taking local copies of reports"
http://www.silverlight.net/getstarted/silverlight-4/

Definitely not ActiveX. No sense spending time on something that out-of-date.

Adobe AIR (essentially, Flash for the Desktop), is something that we considered in my last contract, as opposed to Java applets. Last I checked, though it's been several months, the installation of the AIR runtime environment was fast and easy

Your best bet might be to write a custom application that interacts with your web application. For example, Dropbox lets you synchronize files across computers by use of a background application that watches a Dropbox-enabled folder. It also lets you view your Dropbox files online through a web browser. The Dropbox web application then allows you to delete/move/copy files which is echoed in your local filesystem.

In the demo of Google Wave...
http://www.youtube.com/watch?v=v_UyVmITiYQ&fmt=18
...at 15:30 in, a group of img files are drag-and-dropped from the file system to the browser. The functionality is attributed to Google Gears. This seems a bit different from what Daniel OCallaghan and the official documentation suggest is possible.
Anybody know what's actually possible w/ Google Gear and the local file system?

Related

What cross-browser technology do you use in your web applications to manipulate on client machines?

(I have a problem with Google Chrome improvements that will drop support for my current solutions.)
I work on project where I move desktop system to an Intranet web application.
The crucial requirements are:
to move desktop system to a web application
to reproduce every single functionality from the desktop system in the webapp
While 95% of work requires creating casual web application, there is one thing which is non-standard to handle: my application must perform some actions on the client computer. These includes:
connecting with libraries
launching desktop apps
file manipulation in background
The example scenario is to integrate my system with some machine in the lab. I have to integrate my web application with drivers on client computer via DLL (desktop app did this, so my app have to do this as well).
Theoretically scenarios of the desktop actions may vary and I just want to implement some interface that will handle all the "client-machine" job the desktop app has done, so there is no need to work on every single scenario (but of course every scenario should be tested).
My solution was Java Applet. It worked. But then Google Chrome decided to drop support for NPAPI plugins, so in September'15 Java plugin (and my applet) won't be supported (http://blog.chromium.org/2014/11/the-final-countdown-for-npapi.html).
So my another solution is Java Web Start. It works. But now Google Chrome decided to drop support for background operations of external protocols (https://code.google.com/p/chromium/issues/detail?id=348640), so from Google Chrome 45 my Java Web Start solution won't be supported.
(Both above solutions work on Firefox and IE.)
The question:
What other technology can I use to interact with a client machine from my web app?
Other remarks:
I am reluctunt to write my own PPAPI plugin or Chrome Extension - I prefer one solution working on all major browsers.
I know that StackOverflow community does not like discussions about technologies, so please focus on describing possible solution to my problem.
We struggled with a similar problem as we need to connect/access electronic devices over JNI->DLL. The only technology where this is currently possible are applets. Period. (And even that is tricky since certain combinations of browsers/java versions/operating systems do not work or have problems, but this is another story...)
There are web technologies like HTLM5, JScript which can replace some functionalities of applets however in certain scenarios (like yours) there is no current alternative available - and you named some of those:
connecting with libraries like *.dll, *.so etc.
file manipulations
launching applications
And doing that across browsers and operating systems!
Solutions?
Tell your users that certain browsers can't be used (like Chrome and
Opera Next)
Write individual plugins for each browser (which probably is beyond your budget ;-)
Did you consider writing standalone application(s) in form of an executable file? The user must download and run it however e.g. java or plugins also need to be installed. But then there is the security aspect of that (downloading an and executing an executable file) - certainly not an easy decision
Have a look at FireBreath 2 - (just read about it in some posts, however didn't try it)
There are lots of discussions on SO to this topic so take a read:
alternative technologies to replace applets
applet alternative launch from browser
alternatives to java applet to launch microsoft office applications
alternative-java-applet-network-drive-access
what are the alternatives for java applet to launch client programs using chrome
alternative of npapi plugins for flash java applet
python alternative to java applet
npapi alternative for live file editing
... and many, many more!

IDE for web project working with distant copy

We currently have an intranet host on a server (just Html and js project).
contributors do not have a local copy of the project, and modify the code on a regular basis using Expression web. However, a lot of Expression web's features, like link maintenance, do not work if the project is not on a local cache.
Do you know any good web IDE capable of maintaining a web project directly on a server ?
Thanks
This IDE may work for you it is biased in the cloud.
https://c9.io/

Create folder and directory in actionscript

As a part of flash application, I'm trying to store recorded files automatically to a specific path on users computer hard disk without they be aware.
Is there a way to create directory in actionscript?
If you are using Flash in a web browser, for security reasons there is not. the only option to store something locally within a web browser is to use shared objects (kind of like cookies), but this is likely not what you want.
If you are not in a web browser you can use either AIR or a third party wrapper such as Multidmedia Zinc (for an additional cost).
File options for AIR can be found here:
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/filesystem/File.html
File options for Zinc can be found here:
http://www.multidmedia.com/support/livedocs/zinc/4.0/
EDIT
Since in your comment it sounds like your running in a web browser, you should leave it at simply streaming it to your server. If they have no internet connection there is no other good option other than live streaming using URLRequest, that is, if you are within a web browser.
Here is some additional reading on this subject:
Can Flash action script read and write local file system?
There's a tutorial at http://hub.tutsplus.com/tutorials/create-a-useful-audio-recorder-app-in-actionscript-3--active-5836?request_uri=%2Ftutorials%2Factionscript%2Fcreate-a-useful-audio-recorder-app-in-actionscript-3 which does exactly what you want. Ignore the timeline-driven approach if you wish.
It uses the micrecorder library from https://code.google.com/p/micrecorder/ which records the audio and offers a file for the user to download at the end.

Installing an offline html app and data onto an iPad

I am contemplating buying an iPad and am wondering what options I will have for developing an app for personal use ... specifically whether I will be able to do it as an offline browser app. The app currently exists as an Android Java app; it interacts with a large local database (about 3MB) and displays images and text drawn from a very large pool of resources stored locally (about 2GB).
My immediate questions are:
How would I get the files (html/javascript, database, images and text) transferred into the iPad's storage from a Windows PC? With Android this is a simple matter of hooking up via USB and using Windows Explorer. Googling suggests that for an iPad I might have to use an app on Windows called DiskAid, but this costs $25 which seems a bit steep for my simple purpose. Are there free alternatives?
Once the files are installed on the iPad how would I run the html app? On Android this appears to be a matter of keying "file:///sdcard/MyBrowserAppFolder/mybrowserapp.htm" into the browser's address box. Does th iPad browser work in a similar way.
There are two basic kinds of applications that run on iOS.
Mobile designed web applications that are hosted on a server and accessed through Safari or another browser.
Native applications built using Xcode and usually objective-c.
For the latter, you could use the phonegap framework to build an app using existing html and javascript.
My personal advice is to invest the time to learning how to code this up using objective-c. Depending on what format your db is in, importing the structure and data might be trivial. It will take an investment of time, but doing things using the native tools is the best choice for iOS development in my opinion. I was in the same situation (PHP, VB.NET and Javascript developer) and just decided to take the time and learn to do it right. This was a great decision and the development time of a simple to moderate application takes very little time now.
Safari on iOS does not support the URL's of type file:// natively. So you either write your own app, purchase an app or use something like a local web server after jailbreaking.
Alternatively, and if you can verify that the app you have mentioned does what you want to do, then maybe $25 is not so much of a price. Depends on what your time is worth :)
However there are cheaper apps around that allow to transfer and read html via wifi and usb. (Not sure I can name them here)
The USB transfer aka iTunes Filesharing is a standard function that a developer can enable in the info.plist of their app. Many apps use this to transfer data between Computer and iDevice.

Writing text to .txt files using actionscript

Writing text to .txt files using actionscript. how? i couldn't find anything about that in the internet. is that possible? for flash player.
The flash player (the one in browsers) is run through a sandbox which prevents it from accessing or creating files on the users computer (imagine the chaos if it wasn't!), among other things.
You can store persistent data using SharedObject (but this is not readily visible to the user, only useful for storing settings etc).
The other options is to send the data to a web service which in turn would allow the user to download it. Those are your only options really.
Adobe Air is a different runtime, designed to be used for desktop applications. Eg like any program on your computer. It can do a lot more, but has to be downloaded and possibly installed before you can run it (it will not run from within a HTML page).
Check out Adobe AIR: http://www.adobe.com/devnet/air/flash/quickstart/articles/building_text_editor.html
That's impossible from flash player, only from air.