I am creating a server that downloads an mp3 file to a local folder on the server host computer (a laptop I set up with Windows Server 2019) and then sends that mp3 file to a client. When debugging in Visual Studio, the file downloads to the server and is sent to the client perfectly. However, when deployed on IIS, the file does not download to the server; if I place a file of the same name and type in the folder from the start (so the server doesn't have to download it) the sending functionality does work (both deployed and in debug). The package I am using to download the mp3 file to the server is wrapyoutubedl, and the code it is implemented in is as follows:
var newFilename = selectedvideo.title;
var mp3OutputFolder = @"C:/Users/Administrator/Desktop/lowdatayt/mp3s";
var downloader = new AudioDownloader(urlToDownload, newFilename, mp3OutputFolder);
downloader.ProgressDownload += downloader_ProgressDownload;
downloader.FinishedDownload += downloader_FinishedDownload;
downloader.Download();
The error message produced when running on iis deployed is:
The file wasn't found because the download function didn't download it. Unfortunately, this is the only error given. As an additional note, I have granted full access to this folder to the IIS application pool this is running on, so permissions can't be the problem here.
EDIT: This thread solved my problem: Need to execute *.exe in server from ASP.net