There is a form that works and sends files, but when I try to send a file of more than 34 MB, I get an error
Fatal error: Allowed memory size of 134217728 by exhausted (tried to allocate Y bytes)
Raising the memory_limit directive to 256 did not help!
Error refers to string
$encoded_content = chunk_split(base64_encode($content)) which translates a file into code by type
OEJQUwABAAAAAAAAAAMAABdiAAAGKAAIAAMAAAAAAAFhWDhCSU0EBAAAAAABVxwBWgADGyVHHAFa AAMbJUccAVoAAxslRxwBWgADGyVHHAFaAAMbJUccAVoAAxslRxwBWgADGyVHHAFaAAMbJUccAVoA Well, respectively, in this form, the file is more than 128 MB. If someone knows how to convert a file differently, please tell me!
Further, $encoded_content will be sent to the post office.
$body .= "--$boundary\r\n"; $body .="Content-Type: $file_type; name=".$file_name."\r\n"; $body .="Content-Disposition: attachment; filename=".$file_name."\r\n"; $body .="Content-Transfer-Encoding: base64\r\n"; $body .="X-Attachment-Id: ".rand(1000,99999)."\r\n\r\n"; $body .= $encoded_content;
memory_limit -1do? - Manitikyl