here is the code.
hopefully someone can tell me what i did wrong.
- Code: Select all
// Get the data
// Remove the headers (data:,) part.
// A real application should use them according to needs such as to check image type
$filteredData=substr($imageData, strpos($imageData, ",")+1);
// Need to decode before saving since the data we received is already base64 encoded
// Save file. This example uses a hard coded filename for testing,
// but a real application can specify filename in POST variable
$fp = fopen( "signature_IMG/\\\$acc2.canvas.png", 'wb');
fwrite( $fp, $unencodedData);
fclose( $fp );