I have the following code which I am using in WordPress/Woocommerce:
function generatePassword($length = 6) {
$characters = \'0123456789abcdefghijklmnopqrstuvwxy
You have to provide Web server path of actual file location path in your server instead of url.
$test = 'http://advokatami.bg/ot/a/docs/test/test.txt';
Replace it by Server path
$test = '/ot/a/docs/test/test.txt';
Make sure test have permission for read and write publicly.
1) Make test.php file in ot folder with below code
2) Upload it in ot folder.
3) execute file from browser http://advokatami.bg/ot/test.php
4) Copy path before \ot\.... and replace it on .