The problem is that I can not pass a temporary path to the file in order to convert it into markdown text in the script again later.
Ajax request code:
$('#md').on('click', function(event){ event.preventDefault(); $.ajax({ type: 'POST', url: '<?=$dir?>/ajax/ajax_editor_md.php', data: {file: '<?=$_SERVER["DOCUMENT_ROOT"]."/upload/pdfFiles/670.docx"?>'}, success: function(result){ $('#area').html(result); alert('ready'); document.location.href = "<?=$_SERVER["SCRIPT_URI"]?>"; } }) }); Php handler code:
$converter = new Docx2md\Docx2md; $converter = $converter->parseFile($_REQUEST["file"]); $markdown = $converter->markdown; echo $markdown; How can this problem be solved?
AJAXworking, then: AJAX is executed, it sends a file, you accept the file, make a MARKDOWN, give it away and update the page where everything is empty (because the file is empty). ?) - Manitikylurlin the source? - Manitikyl