tags:

views:

319

answers:

5

I have a number of users with multi-megabyte files that need to be processed before they can be uploaded. I am trying to find a way to do this without having to install any executable software on their machines.

If every machine shipped with, say, Python it would be easy. I could have a Python script do everything. The only scripting language I can think of that's on every machine is JavaScript. However I know there are security restrictions that prevent reading and writing local files from web browsers.

Is there any way to use this extremely pervasive scripting language for general purpose computing tasks?


EDIT: To clarify the requirements, this needs to be a cross platform, cross browser solution. I believe that HTA is an Internet Explorer only technology (or that the Firefox equivalent is broken).

A: 

The application that I maintain and develop for work is an HTML Application or HTA, linked with a SQL Server 2005 backend. This allows various security restrictions to be "avoided". All the client-side components in the application are done with javascript, including writing files to locally mapped network drives and loading data into screens/pages in an AJAXy way.

Perhaps HTA could be helpful for your situation.

Scott Bennett-McLeish
A: 

For an example of javascript accessing a local file, you might try taking a look at the source of TiddlyWiki, specifically the saveFile, mozillaSaveFile, and ieSaveFile functions. Just click the download link, open the html file it sends you, and search for those functions.

Of course, tiddlywiki is supposed to be used as a local file, not served over the web, so the methods it uses may only work locally.. But it might be a start.

Blorgbeard
+2  A: 

Would Google Gears work here? Yes, users have to install something, but I think the experience is fairly frictionless. And once it's installed, no more worries.

xanadont
A: 

Why not use a flash uploader?
http://swfupload.org/

Ballsacian1
A: 

Adobe Flex 4 lets you to open and process a file on a local machine: http://livedocs.adobe.com/flex/3/langref/flash/net/FileReference.html#load()

It's not exactly JavaScript, but hope that helps.

OutputLogic