wget not saving file after download
Clash Royale CLAN TAG#URR8PPP
up vote
4
down vote
favorite
So I am currently using the wget command on windows 10 powershell to download various files. However, when testing this command, files do not actually download.
For example, say I want to download this picture: https://yt3.ggpht.com/-v0soe-ievYE/AAAAAAAAAAI/AAAAAAAAAAA/OixOH_h84Po/s900-c-k-no-mo-rj-c0xffffff/photo.jpg
I would use the following:
PS C:UsersmynameDesktop> wget https://yt3.ggpht.com/-v0soe-ievYE/AAAAAAAAAAI/AAAAAAAAAAA/OixOH_h84Po/s900-c-k-no-mo-rj-c0xffffff/photo.jpg
StatusCode : 200
StatusDescription : OK
Content : 255, 216, 255, 224...
RawContent : HTTP/1.1 200 OK
Access-Control-Expose-Headers: Content-Length
Content-Disposition: inline;filename=""
Vary: Origin
Access-Control-Allow-Origin: *
X-Content-Type-Options: nosniff
X-XSS-Protection...
Headers : [Access-Control-Expose-Headers, Content-Length], [Content-Disposition, inline;filename=""],
[Vary, Origin], [Access-Control-Allow-Origin, *]...
RawContentLength : 31273
Once this process finishes, I do not observe any new files on my desktop.
However, this code does work:
wget https://yt3.ggpht.com/-v0soe-ievYE/AAAAAAAAAAI/AAAAAAAAAAA/OixOH_h84Po/s900-c-k-no-mo-rj-c0xffffff/photo.jpg -O google.jpg
So what is going on? Why does wget alone not download the file?
wget
add a comment |Â
up vote
4
down vote
favorite
So I am currently using the wget command on windows 10 powershell to download various files. However, when testing this command, files do not actually download.
For example, say I want to download this picture: https://yt3.ggpht.com/-v0soe-ievYE/AAAAAAAAAAI/AAAAAAAAAAA/OixOH_h84Po/s900-c-k-no-mo-rj-c0xffffff/photo.jpg
I would use the following:
PS C:UsersmynameDesktop> wget https://yt3.ggpht.com/-v0soe-ievYE/AAAAAAAAAAI/AAAAAAAAAAA/OixOH_h84Po/s900-c-k-no-mo-rj-c0xffffff/photo.jpg
StatusCode : 200
StatusDescription : OK
Content : 255, 216, 255, 224...
RawContent : HTTP/1.1 200 OK
Access-Control-Expose-Headers: Content-Length
Content-Disposition: inline;filename=""
Vary: Origin
Access-Control-Allow-Origin: *
X-Content-Type-Options: nosniff
X-XSS-Protection...
Headers : [Access-Control-Expose-Headers, Content-Length], [Content-Disposition, inline;filename=""],
[Vary, Origin], [Access-Control-Allow-Origin, *]...
RawContentLength : 31273
Once this process finishes, I do not observe any new files on my desktop.
However, this code does work:
wget https://yt3.ggpht.com/-v0soe-ievYE/AAAAAAAAAAI/AAAAAAAAAAA/OixOH_h84Po/s900-c-k-no-mo-rj-c0xffffff/photo.jpg -O google.jpg
So what is going on? Why does wget alone not download the file?
wget
2
Your command looks fine. Where did this implementation ofwget
come from?
â roaima
Apr 19 '17 at 16:19
3
powershell useswget
andcurl
as aliases for its ownInvoke-WebRequest
. It's not clear to me that there is any relationship towget
other than capturing the typing habits of users of other operating systems.
â user4556274
Apr 19 '17 at 16:21
1
Mmm (it's nice to learn something else new). Arguably though, this is off-topic because we're talking about a Powershell command, not a UNIX/Linux utility.
â roaima
Apr 19 '17 at 16:28
@TimothyMartin initially that was my perspective too, but then I thought that it might be worth leaving open so that we can highlight thatwget
isn'twget
. (IYSWIM.)
â roaima
Apr 19 '17 at 17:00
@roaima Good point. I'll retract my vote to close.
â Timothy Martin
Apr 19 '17 at 17:01
add a comment |Â
up vote
4
down vote
favorite
up vote
4
down vote
favorite
So I am currently using the wget command on windows 10 powershell to download various files. However, when testing this command, files do not actually download.
For example, say I want to download this picture: https://yt3.ggpht.com/-v0soe-ievYE/AAAAAAAAAAI/AAAAAAAAAAA/OixOH_h84Po/s900-c-k-no-mo-rj-c0xffffff/photo.jpg
I would use the following:
PS C:UsersmynameDesktop> wget https://yt3.ggpht.com/-v0soe-ievYE/AAAAAAAAAAI/AAAAAAAAAAA/OixOH_h84Po/s900-c-k-no-mo-rj-c0xffffff/photo.jpg
StatusCode : 200
StatusDescription : OK
Content : 255, 216, 255, 224...
RawContent : HTTP/1.1 200 OK
Access-Control-Expose-Headers: Content-Length
Content-Disposition: inline;filename=""
Vary: Origin
Access-Control-Allow-Origin: *
X-Content-Type-Options: nosniff
X-XSS-Protection...
Headers : [Access-Control-Expose-Headers, Content-Length], [Content-Disposition, inline;filename=""],
[Vary, Origin], [Access-Control-Allow-Origin, *]...
RawContentLength : 31273
Once this process finishes, I do not observe any new files on my desktop.
However, this code does work:
wget https://yt3.ggpht.com/-v0soe-ievYE/AAAAAAAAAAI/AAAAAAAAAAA/OixOH_h84Po/s900-c-k-no-mo-rj-c0xffffff/photo.jpg -O google.jpg
So what is going on? Why does wget alone not download the file?
wget
So I am currently using the wget command on windows 10 powershell to download various files. However, when testing this command, files do not actually download.
For example, say I want to download this picture: https://yt3.ggpht.com/-v0soe-ievYE/AAAAAAAAAAI/AAAAAAAAAAA/OixOH_h84Po/s900-c-k-no-mo-rj-c0xffffff/photo.jpg
I would use the following:
PS C:UsersmynameDesktop> wget https://yt3.ggpht.com/-v0soe-ievYE/AAAAAAAAAAI/AAAAAAAAAAA/OixOH_h84Po/s900-c-k-no-mo-rj-c0xffffff/photo.jpg
StatusCode : 200
StatusDescription : OK
Content : 255, 216, 255, 224...
RawContent : HTTP/1.1 200 OK
Access-Control-Expose-Headers: Content-Length
Content-Disposition: inline;filename=""
Vary: Origin
Access-Control-Allow-Origin: *
X-Content-Type-Options: nosniff
X-XSS-Protection...
Headers : [Access-Control-Expose-Headers, Content-Length], [Content-Disposition, inline;filename=""],
[Vary, Origin], [Access-Control-Allow-Origin, *]...
RawContentLength : 31273
Once this process finishes, I do not observe any new files on my desktop.
However, this code does work:
wget https://yt3.ggpht.com/-v0soe-ievYE/AAAAAAAAAAI/AAAAAAAAAAA/OixOH_h84Po/s900-c-k-no-mo-rj-c0xffffff/photo.jpg -O google.jpg
So what is going on? Why does wget alone not download the file?
wget
wget
edited Apr 19 '17 at 16:25
asked Apr 19 '17 at 16:14
Thessentials
262
262
2
Your command looks fine. Where did this implementation ofwget
come from?
â roaima
Apr 19 '17 at 16:19
3
powershell useswget
andcurl
as aliases for its ownInvoke-WebRequest
. It's not clear to me that there is any relationship towget
other than capturing the typing habits of users of other operating systems.
â user4556274
Apr 19 '17 at 16:21
1
Mmm (it's nice to learn something else new). Arguably though, this is off-topic because we're talking about a Powershell command, not a UNIX/Linux utility.
â roaima
Apr 19 '17 at 16:28
@TimothyMartin initially that was my perspective too, but then I thought that it might be worth leaving open so that we can highlight thatwget
isn'twget
. (IYSWIM.)
â roaima
Apr 19 '17 at 17:00
@roaima Good point. I'll retract my vote to close.
â Timothy Martin
Apr 19 '17 at 17:01
add a comment |Â
2
Your command looks fine. Where did this implementation ofwget
come from?
â roaima
Apr 19 '17 at 16:19
3
powershell useswget
andcurl
as aliases for its ownInvoke-WebRequest
. It's not clear to me that there is any relationship towget
other than capturing the typing habits of users of other operating systems.
â user4556274
Apr 19 '17 at 16:21
1
Mmm (it's nice to learn something else new). Arguably though, this is off-topic because we're talking about a Powershell command, not a UNIX/Linux utility.
â roaima
Apr 19 '17 at 16:28
@TimothyMartin initially that was my perspective too, but then I thought that it might be worth leaving open so that we can highlight thatwget
isn'twget
. (IYSWIM.)
â roaima
Apr 19 '17 at 17:00
@roaima Good point. I'll retract my vote to close.
â Timothy Martin
Apr 19 '17 at 17:01
2
2
Your command looks fine. Where did this implementation of
wget
come from?â roaima
Apr 19 '17 at 16:19
Your command looks fine. Where did this implementation of
wget
come from?â roaima
Apr 19 '17 at 16:19
3
3
powershell uses
wget
and curl
as aliases for its own Invoke-WebRequest
. It's not clear to me that there is any relationship to wget
other than capturing the typing habits of users of other operating systems.â user4556274
Apr 19 '17 at 16:21
powershell uses
wget
and curl
as aliases for its own Invoke-WebRequest
. It's not clear to me that there is any relationship to wget
other than capturing the typing habits of users of other operating systems.â user4556274
Apr 19 '17 at 16:21
1
1
Mmm (it's nice to learn something else new). Arguably though, this is off-topic because we're talking about a Powershell command, not a UNIX/Linux utility.
â roaima
Apr 19 '17 at 16:28
Mmm (it's nice to learn something else new). Arguably though, this is off-topic because we're talking about a Powershell command, not a UNIX/Linux utility.
â roaima
Apr 19 '17 at 16:28
@TimothyMartin initially that was my perspective too, but then I thought that it might be worth leaving open so that we can highlight that
wget
isn't wget
. (IYSWIM.)â roaima
Apr 19 '17 at 17:00
@TimothyMartin initially that was my perspective too, but then I thought that it might be worth leaving open so that we can highlight that
wget
isn't wget
. (IYSWIM.)â roaima
Apr 19 '17 at 17:00
@roaima Good point. I'll retract my vote to close.
â Timothy Martin
Apr 19 '17 at 17:01
@roaima Good point. I'll retract my vote to close.
â Timothy Martin
Apr 19 '17 at 17:01
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
7
down vote
The Powershell implementation of wget
is not wget
. So it doesn't behave like the UNIX/Linux utility wget
.
As pointed out by user4556274, Powershell uses wget
and curl
as aliases for its own Invoke-WebRequest
.
Looking at that (or running Get-Help wget
under Powershell) it can be seen that the -O [filename]
flag is an acceptable abbreviation for -Output [filename]
, and that Invoke-WebRequest [URI]
actually returns an object representing a web page rather than writing a file named from the basename of the URL.
Thus, this returns "nothing" unless you assign it to a variable or pipe it to another command:
wget http://example.net/path/to/page.html
But this delivers a web page "as expected":
wget http://example.net/path/to/page.html -O page.html
Makes sense. That is kind of silly that Powershell would use a command that doesn't do what it is commonly known for in UNIX
â Thessentials
Apr 19 '17 at 16:33
1
It has an alias (pardon me -Alias
) that basically "fakes" it. See alsols
which IIRC is an Alias forGet-ChildItem
(with certain parameters).
â DopeGhoti
Apr 19 '17 at 17:29
@DopeGhoti I was aware of the fakels
butwget
was a new one for me. The problem here is that the fakery is only skin-deep.
â roaima
Apr 19 '17 at 18:35
Powershell gonna powershell.
â DopeGhoti
Apr 19 '17 at 18:36
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
7
down vote
The Powershell implementation of wget
is not wget
. So it doesn't behave like the UNIX/Linux utility wget
.
As pointed out by user4556274, Powershell uses wget
and curl
as aliases for its own Invoke-WebRequest
.
Looking at that (or running Get-Help wget
under Powershell) it can be seen that the -O [filename]
flag is an acceptable abbreviation for -Output [filename]
, and that Invoke-WebRequest [URI]
actually returns an object representing a web page rather than writing a file named from the basename of the URL.
Thus, this returns "nothing" unless you assign it to a variable or pipe it to another command:
wget http://example.net/path/to/page.html
But this delivers a web page "as expected":
wget http://example.net/path/to/page.html -O page.html
Makes sense. That is kind of silly that Powershell would use a command that doesn't do what it is commonly known for in UNIX
â Thessentials
Apr 19 '17 at 16:33
1
It has an alias (pardon me -Alias
) that basically "fakes" it. See alsols
which IIRC is an Alias forGet-ChildItem
(with certain parameters).
â DopeGhoti
Apr 19 '17 at 17:29
@DopeGhoti I was aware of the fakels
butwget
was a new one for me. The problem here is that the fakery is only skin-deep.
â roaima
Apr 19 '17 at 18:35
Powershell gonna powershell.
â DopeGhoti
Apr 19 '17 at 18:36
add a comment |Â
up vote
7
down vote
The Powershell implementation of wget
is not wget
. So it doesn't behave like the UNIX/Linux utility wget
.
As pointed out by user4556274, Powershell uses wget
and curl
as aliases for its own Invoke-WebRequest
.
Looking at that (or running Get-Help wget
under Powershell) it can be seen that the -O [filename]
flag is an acceptable abbreviation for -Output [filename]
, and that Invoke-WebRequest [URI]
actually returns an object representing a web page rather than writing a file named from the basename of the URL.
Thus, this returns "nothing" unless you assign it to a variable or pipe it to another command:
wget http://example.net/path/to/page.html
But this delivers a web page "as expected":
wget http://example.net/path/to/page.html -O page.html
Makes sense. That is kind of silly that Powershell would use a command that doesn't do what it is commonly known for in UNIX
â Thessentials
Apr 19 '17 at 16:33
1
It has an alias (pardon me -Alias
) that basically "fakes" it. See alsols
which IIRC is an Alias forGet-ChildItem
(with certain parameters).
â DopeGhoti
Apr 19 '17 at 17:29
@DopeGhoti I was aware of the fakels
butwget
was a new one for me. The problem here is that the fakery is only skin-deep.
â roaima
Apr 19 '17 at 18:35
Powershell gonna powershell.
â DopeGhoti
Apr 19 '17 at 18:36
add a comment |Â
up vote
7
down vote
up vote
7
down vote
The Powershell implementation of wget
is not wget
. So it doesn't behave like the UNIX/Linux utility wget
.
As pointed out by user4556274, Powershell uses wget
and curl
as aliases for its own Invoke-WebRequest
.
Looking at that (or running Get-Help wget
under Powershell) it can be seen that the -O [filename]
flag is an acceptable abbreviation for -Output [filename]
, and that Invoke-WebRequest [URI]
actually returns an object representing a web page rather than writing a file named from the basename of the URL.
Thus, this returns "nothing" unless you assign it to a variable or pipe it to another command:
wget http://example.net/path/to/page.html
But this delivers a web page "as expected":
wget http://example.net/path/to/page.html -O page.html
The Powershell implementation of wget
is not wget
. So it doesn't behave like the UNIX/Linux utility wget
.
As pointed out by user4556274, Powershell uses wget
and curl
as aliases for its own Invoke-WebRequest
.
Looking at that (or running Get-Help wget
under Powershell) it can be seen that the -O [filename]
flag is an acceptable abbreviation for -Output [filename]
, and that Invoke-WebRequest [URI]
actually returns an object representing a web page rather than writing a file named from the basename of the URL.
Thus, this returns "nothing" unless you assign it to a variable or pipe it to another command:
wget http://example.net/path/to/page.html
But this delivers a web page "as expected":
wget http://example.net/path/to/page.html -O page.html
edited 9 mins ago
answered Apr 19 '17 at 16:30
roaima
41.4k547112
41.4k547112
Makes sense. That is kind of silly that Powershell would use a command that doesn't do what it is commonly known for in UNIX
â Thessentials
Apr 19 '17 at 16:33
1
It has an alias (pardon me -Alias
) that basically "fakes" it. See alsols
which IIRC is an Alias forGet-ChildItem
(with certain parameters).
â DopeGhoti
Apr 19 '17 at 17:29
@DopeGhoti I was aware of the fakels
butwget
was a new one for me. The problem here is that the fakery is only skin-deep.
â roaima
Apr 19 '17 at 18:35
Powershell gonna powershell.
â DopeGhoti
Apr 19 '17 at 18:36
add a comment |Â
Makes sense. That is kind of silly that Powershell would use a command that doesn't do what it is commonly known for in UNIX
â Thessentials
Apr 19 '17 at 16:33
1
It has an alias (pardon me -Alias
) that basically "fakes" it. See alsols
which IIRC is an Alias forGet-ChildItem
(with certain parameters).
â DopeGhoti
Apr 19 '17 at 17:29
@DopeGhoti I was aware of the fakels
butwget
was a new one for me. The problem here is that the fakery is only skin-deep.
â roaima
Apr 19 '17 at 18:35
Powershell gonna powershell.
â DopeGhoti
Apr 19 '17 at 18:36
Makes sense. That is kind of silly that Powershell would use a command that doesn't do what it is commonly known for in UNIX
â Thessentials
Apr 19 '17 at 16:33
Makes sense. That is kind of silly that Powershell would use a command that doesn't do what it is commonly known for in UNIX
â Thessentials
Apr 19 '17 at 16:33
1
1
It has an alias (pardon me -
Alias
) that basically "fakes" it. See also ls
which IIRC is an Alias for Get-ChildItem
(with certain parameters).â DopeGhoti
Apr 19 '17 at 17:29
It has an alias (pardon me -
Alias
) that basically "fakes" it. See also ls
which IIRC is an Alias for Get-ChildItem
(with certain parameters).â DopeGhoti
Apr 19 '17 at 17:29
@DopeGhoti I was aware of the fake
ls
but wget
was a new one for me. The problem here is that the fakery is only skin-deep.â roaima
Apr 19 '17 at 18:35
@DopeGhoti I was aware of the fake
ls
but wget
was a new one for me. The problem here is that the fakery is only skin-deep.â roaima
Apr 19 '17 at 18:35
Powershell gonna powershell.
â DopeGhoti
Apr 19 '17 at 18:36
Powershell gonna powershell.
â DopeGhoti
Apr 19 '17 at 18:36
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f359972%2fwget-not-saving-file-after-download%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
2
Your command looks fine. Where did this implementation of
wget
come from?â roaima
Apr 19 '17 at 16:19
3
powershell uses
wget
andcurl
as aliases for its ownInvoke-WebRequest
. It's not clear to me that there is any relationship towget
other than capturing the typing habits of users of other operating systems.â user4556274
Apr 19 '17 at 16:21
1
Mmm (it's nice to learn something else new). Arguably though, this is off-topic because we're talking about a Powershell command, not a UNIX/Linux utility.
â roaima
Apr 19 '17 at 16:28
@TimothyMartin initially that was my perspective too, but then I thought that it might be worth leaving open so that we can highlight that
wget
isn'twget
. (IYSWIM.)â roaima
Apr 19 '17 at 17:00
@roaima Good point. I'll retract my vote to close.
â Timothy Martin
Apr 19 '17 at 17:01