To define the media upload location, simply follow the steps as below –

Step 1. Open wp-config.php file which is located in the root of your WordPress file directory.
Step 2. Add a line of code give below at the end

define( 'UPLOADS', 'wp-content/uploads' );

* wp-content/uploads is the default location where your uploads & media file are saved

Step 3. Save the changed file.

And this will let WordPress know which directory your uploads & media file should go to.