This is an archived forum post. The information may be outdated. Contact us if you have any questions.

Error on fwrite

bellamy wrote on 2012-04-03:
Hi there.
I tried to include this HTML to PDF api (PHP) on my site, but i always get this error:

Warning: fwrite(): supplied argument is not a valid stream resource in /htdocs/public/www/pdfcrowd.php on line 362

I thought it could be permissions beacause my tokens are being spent, but no pdf file is saved, so i created a new php file with a simple:
fopen, fwrite, fclose to the same directory where my pdf was supossed to be saved to, and it works.

Any ideas what the problem could be?

Thank you.

Miguel Ribeiro.
support wrote on 2012-04-03:
Hi, please could you post your PHP code here?
bellamy wrote on 2012-04-03:
Sorry for taking your time, and thank your for so quick response!
It was my mistake, i was fopening in one folder and fwriting to another.
It is working now.

Once again, I am sorry and thank you!

Miguel Ribeiro.
support wrote on 2012-04-03:
No problem! I'm glad our service works for you.