{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "# Downloading Files from Internet\n",
    "\n",
    "is done by the `download()` command. \n",
    "\n",
    "In Julia 1.6+ it is probably better to do\n",
    "```\n",
    "Import Downloads\n",
    "Downloads.download()\n",
    "```"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "if !isdir(\"Results\")\n",
    "    error(\"create the subfolder Results before running this program\")\n",
    "end"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Some Data from Kenneth French's Homepage"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "File to download: http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/ftp/F-F_Research_Data_Factors_daily_CSV.zip\n",
      "\n",
      "check the subfolder Results\n",
      "\n"
     ]
    }
   ],
   "source": [
    "http   = string(\"http://mba.tuck.dartmouth.edu/pages/faculty/ken.french/ftp/\",\n",
    "                \"F-F_Research_Data_Factors_daily_CSV.zip\")\n",
    "\n",
    "println(\"File to download: \",http)\n",
    "download(http,\"Results/WhatIJustDownloaded.zip\")\n",
    "\n",
    "println(\"\\ncheck the subfolder Results\\n\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "@webio": {
   "lastCommId": null,
   "lastKernelId": null
  },
  "anaconda-cloud": {},
  "kernelspec": {
   "display_name": "Julia 1.6.1",
   "language": "julia",
   "name": "julia-1.6"
  },
  "language_info": {
   "file_extension": ".jl",
   "mimetype": "application/julia",
   "name": "julia",
   "version": "1.6.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
