Download and unzip a file from a Gadget ?

Hi,

My gadget needs to download (via HTTP) a zip file and unzip it. This file contains information so local search can be done on client side.

In Dashboard/Yahoo we have curl and unzip unix utilities to easily achieve that with some simple system call.

How can you do that with Microsoft Gadgets

Thanks in advance,


Answer this question

Download and unzip a file from a Gadget ?

  • Andrew Buyan

    Tom : I don't think I can develop an app myself, I probably don't have the talent for that yet. I was simply hoping that Gadgets could offer more power to the developers.

    Jonathan : No unfortunately, it's not FTP but HTTP.

    So I'll surely have to package some Freeware/GNU applications inside the gadget itself for now...

    Thanks for you help!



  • Kamen

    I don't think MS's ZIP is exposed via COM, so you'd have to either include a command line based extractor in the Gadget, or write a COM wrapper DLL around MS's ZIP.

    Your best bet is to get a free command line extractor, like 7-Zip and use it's 7z.exe command line EXE, which you can call from your Gadget as described in this thread.

    Just bare in mind that you will run into security issues if you're extracting it to anywhere other than the Gadget directory (System.Gadget.path), or one of it's sub directories.

    If you create blank subdirectories in your Gadget to do this, make sure there's at least one dummy file in them, otherwise Sidebar will report the Gadget is corrupt, and it won't install.

  • Donaghy

    why don't you write a app that downloads your file and extract the content
  • su45937

    PKZIP you can't distribute. 7-Zip you can as it comes under GNU, read the FAQ on their site.

    Where the ZIP is coming from will determine how you download it.

  • akaRickShaw

    DOS ftp - is one way. If it's coming from an FTP site.

  • David S. Anderson

    I'm very curious about how to download binary files from internet to local in pure javascript... I have no idea.

  • Barry Mull

    You should be able to use good old pkzip via the command line
  • Maartin

    Thanks for that answer. I already thought about that solution, but there's two things that I was concerned. The final size of the Gadget will be alot bigger, and maybe copyright issue from the author of such a 3rd party unzip software.

    And how about to download the ZIP file itself Any ideas


    Thanks in advance!

  • Download and unzip a file from a Gadget ?