I will need to output from the die statement to see more information about the issue. You currently have the die statement just after the code on line 101, you will need to udpate it so that the die statement occurs before the code that is currently on line 101. Sorry for the confusion.
With the die statement before the download file server behavior it will print a message to the screen with the details of the download. I will need to see this info to proceed.