Skip to content

Instantly share code, notes, and snippets.

@phil21
Created August 4, 2016 20:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phil21/ab8e45b693836686a191d0e47b8c4a97 to your computer and use it in GitHub Desktop.
Save phil21/ab8e45b693836686a191d0e47b8c4a97 to your computer and use it in GitHub Desktop.
sub download_file {
my ( $self, $file ) = @_;
my $file_path = "/storage/mirrors/supermicro/" . $file->{'filename'};
my $ua = Mojo::UserAgent->new();
my $tx = $ua->get($file->{'url'});
$tx->res->content->asset->move_to($file_path);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment