1

Is there an easy way to download and save a .zip file from a URL to my computer through Mathematica? I am trying to develop an auto-update function for a mathematica package that is distributed via GitHub.

I tried Import[http://github.com/******.zip], but that only gave me the names of the files in the folder, but not the actual files or a way to save them. Any suggestions?

Asas
  • 198
  • 7
  • Did you try URLSave? – C. E. Nov 29 '14 at 01:15
  • You can try Import[http://github.com/******.zip, "*"] and check the documentation. – Karsten7 Nov 29 '14 at 01:23
  • @Pickett URLSave gave me the error code: URLSave::invhttp: Failed writing received data to disk/application"

    @Karsten7. Import takes over 20 minutes to work, because I believe it is downloading, unzipping, and parsing the files, when I just need to save and unzip the file.

    Thank you both for ideas though.

    – Asas Nov 29 '14 at 09:43

2 Answers2

3

(I cannot post this as a comment, sorry.)

Your question seems to be a duplicate of this one: Downloading files without using Import.

I have just checked the solution from there, it downloads fine zip-files from GitHub. For extracting downloaded package, you can use ExtractArchive function.

kmingulov
  • 539
  • 2
  • 9
2

Found an easy solution: Use SystemOpen["https://github.com/****.zip"]. This will open the file in the system browser, and start the download!

(Decided to post the solution here in case others have the same question)

Asas
  • 198
  • 7