Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It sounds very much like your php was compiled with <a href="http://www.hardened-php.net/suhosin/" rel="nofollow">Suhosin</a>. The <a href="http://www.hardened-php.net/suhosin/configuration.html" rel="nofollow">default limit</a> of length for any post variable with Suhosin is 65000 bytes which is quite close to what you are estimating as your limit.</p> <p>In fact, your server is sending the <code>X-Powered-By</code> header with a value of <code>PHP/5.2.6-1+lenny9</code>. I googled this package version and on the Debian website they mention it was <a href="http://packages.debian.org/lenny/php5-common" rel="nofollow">built with Suhosin</a>.</p> <p>Since you do not have control over your server configuration, the solution would be to split up the canvas data into multiple variables below the post length limit of your server and then reassemble in PHP. If you check your <code>phpinfo()</code> it should show all these limits.</p> <p><strong>Edit</strong> - Added example code</p> <p><strong>Javascript:</strong></p> <pre><code>var canvasData = canvasP.toDataURL(); var length = canvasData.length; var content = ''; var index = 0; var limit = 64999; var l; while (length &gt; 0) { if (length &lt;= limit) l = length; else l = limit; content += '&amp;content[]=' + canvasData.substr(index * limit, l); length -= l; index++; } xhr.send(content); </code></pre> <p>I don't believe you need the <code>encodeURIComponent()</code> you have because <code>toDataURL()</code> encodes as base64 which is url safe.</p> <p><strong>PHP:</strong></p> <pre><code>if (!empty($_POST['content']) &amp;&amp; is_array($_POST['content'])) { $content = ''; foreach ($_POST['content'] as $part) { $content .= $part; } $content = base64_decode($content); } </code></pre> <p>Not the most efficient method to do this, but it may help you.</p> <p>This will still have it's limits with Suhosin, but you will be able to send much more data this way. Looks like you will be limited to 64 parts of 65000 bytes in an array before you will also have to use multiple arrays. However, at that point it will already getting way too large for most people to be uploading often and it would probably be better to send the changes to the image somehow instead of the whole image.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload