Answers for "jspdf save in server"

0

jspdf save in server

//in your Javascript
<script>
var blob = doc.output('blob');

            var formData = new FormData();
            formData.append('pdf', blob);

            $.ajax('/upload.php',
            {
                method: 'POST',
                data: formData,
                processData: false,
                contentType: false,
                success: function(data){console.log(data)},
                error: function(data){console.log(data)}
            });
</script>

//In your upload.php file:
<?php
move_uploaded_file(
    $_FILES['pdf']['tmp_name'], 
    $_SERVER['DOCUMENT_ROOT'] . "/uploads/test.pdf"
);
Posted by: Guest on January-15-2021
0

jspdf save in server

//in your Javascript
<script>
var blob = doc.output('blob');

            var formData = new FormData();
            formData.append('pdf', blob);

            $.ajax('/upload.php',
            {
                method: 'POST',
                data: formData,
                processData: false,
                contentType: false,
                success: function(data){console.log(data)},
                error: function(data){console.log(data)}
            });
</script>

//In your upload.php file:
<?php
move_uploaded_file(
    $_FILES['pdf']['tmp_name'], 
    $_SERVER['DOCUMENT_ROOT'] . "/uploads/test.pdf"
);
Posted by: Guest on January-15-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language