E
E
Exploits2015-01-26 10:32:38
PHP
Exploits, 2015-01-26 10:32:38

How to get a file on the server from base64, that is, decode the code into base64 and move it to a folder on the server?

Guys, the file is sent in the post request in base64 format, the following line: data:;base64,UEsDBBQAAAAIAEYAN0bgiXMTficA.... etc.
But I need to re-encode the line of code into a file, which I can move to the desired directory, for example, download the prompt function. I know there is base64_decode but I can't use it to decode and create a file on the server.
Tell me how to do this. Thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Bay, 2015-01-26
@kawabanga

$str = base64_decode($_POST['string']);
and then create the required file and write the data there.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question