413 Request Entity Too Large

I’m working on a small site that saves png files to the server (DH shared hosting)

the files are small: 960x540

but for some reason I’m getting apache errors: 413 Request Entity Too Large

any advice on how to fix this?


How are you trying to save those files to the server, and how large are they (in terms of file size)?

Hi Andrew

filesize - they range from 96kb to 300kb
all are 960 x 540 pixels PNG files

I’m using the following code to save to the server

if (isset($_POST["image"]))
// Get the data like you would with traditional post
// Remove the headers  
$removeHeaders=substr($rawImage, strpos($rawImage, ",")+1);

// decode it from base 64 and into image data only

// save to your server
$fname = "temp/".uniqid("img").".png";
$fopen = fopen($fname, 'w' );
fwrite( $fopen, $decode);
fclose( $fopen );

print $fname;


I’d try PHP 5.4