note 43131 deleted from function.base64-decode by cmb

From: Date: Tue, 09 Jun 2015 17:05:35 +0000
Subject: note 43131 deleted from function.base64-decode by cmb
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-202792@lists.php.net to get a copy of this message
Note Submitter: paul at ijsfontein dot nl ---- The user notes posted here helped me a lot in writing the PHP code to upload uuencoded files to a server using $_POST. Hardest thing to figure out was why the files came out scrambled and corrupted. After comparing the original file with the file reconstructed by the uudecode script, I found out that a simple "stripcslashes" on the posted data will do the trick. So, to upload any kind of uuencoded file using a POST: 1. send the raw file data to the PHP script 2. $uuencoded_data = stripcslashes($_POST['filedata']); 3. strip the marker lines from $uuencoded_data (first line, last line and second last line of the data. Each line is seperated by a LF (chr(10)) character.) 4. $decoded_data = uudecode($stripped_uuencoded_data); (this function can be found in the user notes here). 5. Use the script provided in one of the user notes on this page to write the decoded data to a binary file. That should do the trick!

« previous php.notes (#202792) next »