This code has nothing to do with the Acrobat SDK. It looks like something you are running on your server in an environment that I am not aware of the details of.
I would personally recommend that you write the same data that you are writing to the client to a local file and then try to open that up locally (on the server). Do you see the same error(s)?