I am having trouble getting my code to open an image file for writing. The code works fine when I try it out in the terminal, but when I run it in a web browser, it dies when it comes to opening the file. What is the reason for this?
This the portion of my code where I am having a problem.
This the portion of my code where I am having a problem.
Code:
open(IMAGE, ">/directory/mygraph.png") or die "Not able to open image file\n";
binmode IMAGE;
print IMAGE $image->png or die "Problem writing to image file\n";