Save file from URL using mathematica

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?

=================

  

 

Did you try URLSave?
– C. E.
Nov 29 ’14 at 1:15

  

 

You can try Import[http://github.com/******.zip, “*”] and check the documentation.
– Karsten 7.
Nov 29 ’14 at 1: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.
– 4s4s3rt
Nov 29 ’14 at 9:43

=================

2 Answers
2

=================

(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.

  

 

Oh wow I don’t know how I missed that. That’s an even better fix! Thank you!
– 4s4s3rt
Nov 29 ’14 at 20:18

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)