1
$\begingroup$

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?

$\endgroup$
  • $\begingroup$ Did you try URLSave? $\endgroup$ – C. E. Nov 29 '14 at 1:15
  • $\begingroup$ You can try Import[http://github.com/******.zip, "*"] and check the documentation. $\endgroup$ – Karsten 7. Nov 29 '14 at 1:23
  • $\begingroup$ @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. $\endgroup$ – Asas Nov 29 '14 at 9:43
3
$\begingroup$

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

| improve this answer | |
$\endgroup$
  • $\begingroup$ Oh wow I don't know how I missed that. That's an even better fix! Thank you! $\endgroup$ – Asas Nov 29 '14 at 20:18
2
$\begingroup$

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)

| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.