2.5.2.8. Placing a file on a hosting and getting a link to it
Important points:
- It is recommended to use in file names latin... When uploading files with national alphabets in their names, you may need to converting the encoding of file names via the console.
- If the file name contains uppercase characters (capital letters), then it must be indicated in the same way in the link. It is recommended to use symbols in file names lowercase (small letters).
- When it changes root directory site will also change the path where you want to download the file. The directory specified in the settings will be added to it.
- The accessibility of the uploaded file may be affected by the access restrictions specified in the file. .htaccess.
- Openup filemanager or connect to hosting using any FTPclient.
- Go to root directory site, which will host the desired file, or its subdirectory. The path to the root directory looks like this:
- For a site on the main domain -
example.com/www
, whereexample.com
— the name of your site. - For a site on a subdomain -
example.com/subdomain
, whereexample.com
- the name of your site, andsubdomain
— the name of the subdomain of this site.
- Download the file from your PC to this directory. The download process using the file manager is described in detail here.
- Direct links to the uploaded file will look like this:
- For a site on the main domain:
- If the file was uploaded directly to the root directory -
http://example.com/file.php
, wherefile.php
Is the name of the uploaded file. - If the file was loaded into any of the subdirectories -
http://example.com/directory/file.php
, wherefile.php
Is the name of the uploaded file, anddirectory
— the name of the subdirectory where it was loaded.
- For a site on a subdomain:
- If the file was uploaded directly to the root directory -
http://subdomain.example.com/file.php
, wherefile.php
Is the name of the uploaded file. - If the file was loaded into any of the subdirectories -
http://subdomain.example.com/directory/file.php
, wherefile.php
Is the name of the uploaded file, anddirectory
— the name of the subdirectory where it was loaded.
- Check the availability of the downloaded file from the link.