Page 1 of 1

Problem with ASCII and URL encoding

Posted: Wed May 13, 2009 8:46 am
by hidz_stitch
Help!!
Can anybody tell me is there any way to ascii encode the pdf file then do the url encode and vice versa?

pdf file -> ascii encode -> url encode
url decode -> ascii decode -> pdf


can anyone show me the example??
I really stuck on it.. :cry:

Re: Problem with ASCII and URL encoding

Posted: Thu May 14, 2009 3:31 pm
by Darhazer

Code: Select all

$content = file_get_contents($pdfFile);
$ascii = base64_encode($content);
$url = url_encode($ascii);
 
$ascii = url_decode($url);
$content = base64_decode($ascii);
 
Any questions?