note 46962 added to function.base64-encode

From: Date: Thu, 28 Oct 2004 17:35:30 +0000
Subject: note 46962 added to function.base64-encode
Groups: php.notes 
Request: Send a blank email to php-notes+get-79283@lists.php.net to get a copy of this message
Problem: mime attachments sending as blank or almost completely blank documents (all data is lost) Explanation: After a couple days of trying to mime pdf attachments without losing all data, I finally came across this function in some obsolete obscure post: set_magic_quotes_runtime() This is set to on by default in the machine, and it causes fread() and/or base64_encode() (both used in most mime examples I've seen) to read or encrypt binary without slashes for special characters. This causes sent files to process incorrectly, breaking, thus truncating most of the data in the file. Fix: pass 0 to this function and it will do a one time turn off while your code executes. example: <?php set_magic_quotes_runtime(0); ?> This can also been turned off in the php.ini file, but I'm not sure what uses that setting or what the consequences might be. info: http://us2.php.net/manual/en/function.set-magic-quotes-runtime.php ---- Manual Page -- http://www.php.net/manual/en/function.base64-encode.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+46962 Delete -- http://master.php.net/manage/user-notes.php?action=delete+46962&report=yes Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+46962&report=yes&reason=bad+code Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+46962&report=yes&reason=spam Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+46962&report=yes&reason=useless+example Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+46962&report=yes&reason=contains+commercial+links Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+46962&report=yes&reason=useless+note Reject -- http://master.php.net/manage/user-notes.php?action=reject+46962&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#79283) next »