Error using file_put_contents

Hello…
When execute file_put_contents, in the Scriptcase temp dir (or any another), this show the error: failed to open stream: Permission denied

file_put_contents(D:/NetMakev9/wwwroot/scriptcase/tmp/FC-A-0002-00017036.pdf ): failed to open stream: Permission denied

My Code:
$folder = $_SERVER[‘DOCUMENT_ROOT’];
$folder.= $_SESSION[‘scriptcase’][‘Envio_Mail_Comprobante’][‘glo_nm_path_imag_temp’]."/";
file_put_contents($folder.$filenombre, $ubot);

How i can solve?
Thanks!!!

Hello,
it seems to be a problem with the rights management of your server.

If your server is using Unix/Linux this is pretty common.
It’s not a Scriptcase issue, but you will have to work it out on a server level.

If it’s Windows - sorry I don’t know enough about Scriptcase development running on Windows. But there should not be any permission issues :frowning:

Hope this get’s you into the right direction.

Sincerely
Gunter Eibl
https://scriptcase.coach/

Thanks! My server is Windows…
And not try in the production server.
But i run all as administrator, and have full rights…
Thanks!!

OK. I try, and if i save the file as jpg… work fine!!!
And if i save whit extensión pdf… fail…
Some config in apache or php?

Thanks!!

Ok…
If assign the filename, works fine
{ArchivoAdjunto} = $folder.“ArchivoAdjunto.pdf”;
file_put_contents({ArchivoAdjunto}, $ubot);

But if the filename is a field of database
$filenombre = {rs1[0][1]};
{ArchivoAdjunto} = $folder.$filenombre;
file_put_contents({ArchivoAdjunto}, $ubot);

the error is displayed…