views:

402

answers:

2

Hi All,

I need to download two Excel files onto the client, and then run a (diff) executable against them. I know how to download a single Excel file, from here. But how to download a second one automatically in succession? And then how to run a batch command on them? Is this even realistic? Any guidance or pointers would be greatly appreciated.

Thanks,
Mike

+1  A: 

Well, just some pointers because I'm not sure I completely understand the problem. You a user to be given two downloads at the same time and then run a diff command against those two files? On the server or the client i'm not sure? You'll have alot of problems automating the client side version because forcing people to run client side code is usually frowned upon by virus protection software.

The server side diff sounds exactly like a CGI moment to me: http://www.cs.tut.fi/~jkorpela/perl/cgi.html. That will allow you to generate a web-page that shows the diff between the two. CGI allows you to run programs on your server and display their output in a webpage; that's the simple explanation.

If that was not quite what you wanted then feel free to give me a comment and i'll try and edit to answer correctly.

Robert Massaioli
> You a user to be given two downloads at the same time and then run a diff command against those two files?Yes.>On the server or the client i'm not sure?Everything must run on the client.
Mike
For trust reasons you would not be able to run things on the client side with ease. By client side I mean the person that uses your website. Would you let anyone that made a website run code on your computer? That's why I would suggest trying to do everything on your server and only using javascript to do client-side work if you must.
Robert Massaioli
But breaking a client is much better than breaking the server.
Mike
+1  A: 

To download multiple files at once you have two main options:

1) Just open multiple windows to your page generation script to download multiple files as per http://www.webdeveloper.com/forum/showpost.php?s=b4f6b25edeb6b7ea55434c4685a675fe&p=950225&postcount=6

2) Archive the files into a package (zip/arj/7z etc..) and send the archive to the client. eg. http://www.motobit.com/tips/detpg_multiple-files-one-request/

As for doing the diff client-side that is a lot more tricky as Shhnap has already mentioned. If you are doing this for a controlled client base you may be able to get them to allow permissions for an ActiveX script that runs something client side. (Or fire off a console application) - but if you don't have fine control over the client environment then i can't think of a way to do it.

As Shhnap suggested can you not just do the comparison server-side (and then send this to the client as a third file?)

mundeep
Just for the sake of argument, what would be the disadvantages of doing the work server-side? I want to understand all options. Great answer by the way.
Mike
Only one i can think of is a greater load on the server (though if the files don't change often you may be able to cache the diffs).
mundeep