Question: I try to download file so `wget -P /var/www/html/wp-content/uploads/movies/2019/ -O love.mp4 https://example.com/video.mp4`

But it locates the file in `root` and not in `/var/www/html/wp-content/uploads/movies/2019/`

Answer: 
Like this :

```
mkdir -p /var/www/html/wp-content/uploads/movies/2019
wget -O /var/www/html/wp-content/uploads/movies/2019/love.mp4 \
    https://example.com/video.mp4

```
Using `-O` and `-P` may not work as you expect. Try just specifying -O if you're downloading one file.

```
wget -O /var/www/html/wp-content/uploads/movies/2019/love.mp4 \
https://example.com/video.mp4`

```

In this example, I get a file to be named love.mp4 in my `/var/www/html` directory. I'm running the command as sudo because I don't have permissions as a regular user.

```
user@server:/var/www/html$ sudo wget -O /var/www/html/love.mp4  https://file-examples.com/wp-content/uploads/2017/04/file_example_MP4_1920_18MG.mp4
--2020-06-09 20:00:43--  https://file-examples.com/wp-content/uploads/2017/04/file_example_MP4_1920_18MG.mp4
Resolving file-examples.com (file-examples.com)... 185.135.88.81
Connecting to file-examples.com (file-examples.com)|185.135.88.81|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 17839845 (17M) [video/mp4]
Saving to: ‘/var/www/html/love.mp4’

/var/www/html/love.mp4   100%[==================================>]  17.01M  7.87MB/s    in 2.2s

2020-06-09 20:00:46 (7.87 MB/s) - ‘/var/www/html/love.mp4’ saved [17839845/17839845]

user@server:/var/www/html$

```