-
-
Notifications
You must be signed in to change notification settings - Fork 726
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added DownloadFile alias #273
Conversation
// We track the last posted value since the event seems to fire many times for the same value | ||
var percentComplete = 0; | ||
|
||
var http = new System.Net.WebClient(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we're using this in a sync fashion we should wrap in a using block, so streams/responses gets deallocated.
@Redth hi looks good just left one comment. |
@Redth Looks good, I'll take a look later to day and merge if I don't find anything else. |
Random idea would also be an alias which does the same thing, but drops it in the appropriate "temp" directory and passed back a path/ |
I like @RichiCoder1's idea as well. Ok if I add tomorrow? |
@RichiCoder1 @patriksvensson download string / bytes would be nice additions to. if your at it;) |
Well, download a file as string/byte feels unsafe. Wouldn't it be better to
|
@patriksvensson methods allready exists on the standard .net WebClient which this pr uses |
I do a lot of downloading of external files in my build scripts.
This adds a new
HttpAliases
class with (so far) a singleDownloadFile(string url, DirectoryPath outputPath)
alias which does exactly what it looks like.Eventually there could be more HTTP related aliases here such as
DownloadString