asked on April 30, 2019
I use file upload in Laserfiche form to capture photo using mobile camera then I custom Javascript code to convert this photo to base64 to save it in database. the problem that base64 characters length is more than 30,000 character and it not accepted in workflow and it make database size big. are there any idea to reduce base 64 characters or to store image to sql database from laserfiche forms.
here my code to convert image to base64
$(document).ready(function(){ ( function ( $ ) { $('#q2 input').on('change', function () { if ( ! window.FileReader ) { return alert( 'FileReader API is not supported by your browser.' ); } var $i = $( '#q2 input' ), input = $i[0]; if ( input.files && input.files[0] ) { file = input.files[0]; fr = new FileReader(); fr.onload = function () { $( '#q4 textarea' ).html( fr.result ) }; fr.readAsDataURL( file ); } else { alert( "File not selected or browser incompatible." ) } } ); } )( jQuery );
0
0