Change URL database information to send the information in base64
Use the file "fileWrite.php" in the Apache server. The first ".htaccess" allows access to apache without CORS errors. The second ".htaccess" allows access to file only using the file "fileDownload.php" through the variable "fileName=file"