My goal is to have a webform with a link for the client to download a PDF, this PDF should come from a HTTP request from a server in our network and I will display it via webform to the public.
I'm not able to receive the full response for a PDF on an HttpClientRequest, it seems that everytime the pdf is incomplete, if I try with a website URL the response is longer and ok, but never with PDF.
I've try all kinds of hearders but with no success.
Ok so if it is the only reason, you should get the file (urlGet), saving it "locally" on the Adobe Campaign res specific sub-folder of your choice, then you expose this file to the webform link/button.
Using MD5 for naming the "local" file and so reduce security issue for such public folder. Then cleansing the subfolder either immediately or not.
Perhaps someone else could give other advices for doing the same easily.
You are right, because the transfer starts successfully even though not complete, it is not a question of permissions/network access, sorry for my bad suggestions in your case.
In your workflow, did you put try/catch as well?
To my mind, it should be a question of some specific characters treated as end of file/stopping transmission or something like that, because pdf is binary file, not text file. The same for logInfo() perhaps broken as well? Not sure, sorry.
Please read in JSAPI documentation the memoryBuffer function and manipulation for such binary contents, probably you would save the content in a file (without logInfo) and then compare the saved file with the original file.
But I wonder, why must be read the pdf content and display it in a webApp (I guess with an iframe)? Won't it be possible to use an iframe with the file with argument and the standard Adobe Reader web object doing the job for displaying the content?