Reputation: 13
I'm using fopen, fwrite and fclose to save a PNG onto my server using this code:
ini_set('memory_limit', '128M');
$f = fopen('../../myFolder/myImage.png', 'w+');
fwrite($f, base64_decode($lowerDesign));
$success = fclose($f);
echo $success != false ? '1' : '0';
Now this works perfectly for small file sizes (1-5kb) but fails for larger images. I'm getting absolutely no errors in my logs whatsoever. All I get is a '0' instead of a '1' and there is no PNG saved.
Obviously, the file size is the issue but I can't think of how to get around it.
Any ideas?
Upvotes: 1
Views: 1488
Reputation: 960
Split $lowerDesign into small chunks, base64_decode() has issues with large amounts of data
Upvotes: 1