PHP Email Attachment Corrupt Solution -

PHP Email Attachment Corrupt Solution

I couldn't figure out why this wouldn't work, a test script in the root of my htdocs folder worked fine.

Within some subdirectories the same code would produce different base64 results but I didn't know hwy.



Archive:  /tmp/archive.zip
Zip file size: 6888 bytes, number of entries: 92
error [/tmp/archive.zip]:  missing 242827681 bytes in zipfile
  (attempting to process anyway)
error [/tmp/archive.zip]:  attempt to seek before beginning of zipfile
  (please check that you have transferred or created the zipfile in the
  appropriate BINARY mode and that you have compiled UnZip properly)

Here was the problem in .htaccess!

It was because magic_quotes_gpc was being turned of by my htaccess within the subdirectory.

Now after disabling it the e-mail attachment zip is not corrupt and works fine but it was a big headache and definitely required a lot of digging/headscratching.

#php_flag magic_quotes_gpc off 
#php_flag magic_quotes_runtime on

*Update

It turns out that the real issue was just the "magic_quotes_runtime" being on.  It still works fine with the magic_quotes_gpc being turned off.


  • Install Windows From a Linux TFTP Server instead of using WDS Solution
  • How To Secure Samba NMBD/SMBD to bind to a specific IP address
  • tftp: client does not accept options - solution if you are using UEFI PXEBoot disable it!
  • Linux how to view video card make and exact model
  • Authentication refused: bad ownership or modes for directory /home/user SSH Public Key Authentication Failed Solution
  • How to Update Linux /usr/share/misc/pci.ids
  • pcimodules and lspci not working alternative solution
  • How to disable Google Fonts in Wordpress
  • Unable to load dynamic library /usr/lib64/php/modules/php_openssl
  • mysqld in Linux hacked
  • W: GPG error: http://archive.debian.org squeeze Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY AED4B06F473041FA NO_PUBKEY 64481591B98321F9
  • cannot mount kvm ntfs image
  • h264 DVR security camera footage cannot be played
  • dhcpd.conf how to secure so only known and allowed clients will be given dhcpd IP address leases
  • Thunderbird E-mail List Blank White but e-mails still clickable and viewable
  • css responsive images
  • responsive table without changing much code solution
  • yum how to install old obsolete packages
  • PHP Howto Store Value of Included File Output Into Variable
  • PHP Migration from 5.3 to 5.4+ and dealing with deprecated functions