I
I
IamGod20212021-02-24 22:19:10
AJAX
IamGod2021, 2021-02-24 22:19:10

How to upload a file using Ajax and receive it in a PHP script if the uploaded file is passed as code?

Hello everyone!

How to upload a file using Ajax and receive it in a PHP script if the uploaded file is passed as code?
the file comes to ajax upon request in the form of a code, for example, for PDF, this file code is:

%PDF-1.7
%вгПУ
7 0 obj
<< /Type /Page /Parent 1 0 R /LastModified (D:20210224221759+03'00') /Resources 2 0 R /MediaBox [0.000000 0.000000 595.276000 841.890000] /CropBox [0.000000 0.000000 595.276000 841.890000] /BleedBox [0.000000 0.000000 595.276000 841.890000] /TrimBox [0.000000 0.000000 595.276000 841.890000] /ArtBox [0.000000 0.000000 595.276000 841.890000] /Contents 8 0 R /Rotate 0 /Group << /Type /Group /S /Transparency /CS /DeviceRGB >> /Annots [ 6 0 R ] /PZ 1 >>
endobj
8 0 obj

How to pass such kind of file to PHP handler and accept it correctly?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
IamGod2021, 2021-02-24
@IamGod2021

Solution:
Find a function to generate a PDF file and generate directly in the PHP handler by calling this action via Ajax!
So that!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question