problem with FileByteStream.php #298
Comments
+1 |
Try using the full path, using only the filename FileByteStream can not determine the directory the file is in. |
I have the same problem with dynamic attachment: $debug_data = 'Exception: ' . $e_message . PHP_EOL;
$debug_data .= $file . ': ' . $line . PHP_EOL;
$debug_data .= $trace;
$attach = Swift_Attachment::newInstance($debug_data, 'debug.txt', 'text/plain');
$message->attach($attach); error:
|
Thats strange, its correct according to the documentation. And I can't find any strange things in the source, @ammont can you make a small script to reproduce this? |
This seems to be an fopen on the mime entity converted to string, it's On Wed, Jan 22, 2014 at 10:02 AM, Sebastiaan Stok
Xavier De Cock |
I'm experiencing this issue too with 5.2.1 I've got a PDF string generated by mPDF and I'm doing this: $Attachment = Swift_Attachment::newInstance($PDFContent, $fileName, 'application/pdf'); But I'm getting a
|
:| it's not the good syntax for b64 wrapper (or try the php://temp / memory http://php.net//manual/en/wrappers.php.php On Tue, Jul 15, 2014 at 5:13 PM, James Brooks notifications@github.com
Xavier De Cock |
@xdecock wouldn't that have to be implemented in SwiftMailer itself? I've tried sending it handles etc. |
My bad. Laravel has a method called |
eheh : http://php.net/manual/en/wrappers.data.php this is the good system otherwise you can create "raw" mime part On Tue, Jul 15, 2014 at 5:16 PM, James Brooks notifications@github.com
Xavier De Cock |
sviftmailer used in AVE.CMS 3.0RC2 v1.3
When submitting a form, which is present in the field, attach a file, an error:
Warning: fopen(тестовый_файл.docx) [function.fopen]: failed to open stream: No such file or directory in Z:\home\ave-okna.ru\www\lib\SwiftMailer\classes\Swift\ByteStream\FileByteStream.php on line 125
Fatal error: Uncaught exception 'Swift_IoException' with message 'Unable to open file for reading [тестовый_файл.docx]' in Z:\home\ave-okna.ru\www\lib\SwiftMailer\classes\Swift\ByteStream\FileByteStream.php:126 Stack trace: #0 Z:\home\ave-okna.ru\www\lib\SwiftMailer\classes\Swift\ByteStream\FileByteStream.php(75): Swift_ByteStream_FileByteStream->_getReadHandle() #1 Z:\home\ave-okna.ru\www\lib\SwiftMailer\classes\Swift\Mime\SimpleMimeEntity.php(647): Swift_ByteStream_FileByteStream->read(8192) #2 Z:\home\ave-okna.ru\www\lib\SwiftMailer\classes\Swift\Mime\SimpleMimeEntity.php(331): Swift_Mime_SimpleMimeEntity->_readStream(Object(Swift_ByteStream_FileByteStream)) #3 Z:\home\ave-okna.ru\www\lib\SwiftMailer\classes\Swift\Mime\SimpleMimeEntity.php(441): Swift_Mime_SimpleMimeEntity->getBody() #4 Z:\home\ave-okna.ru\www\lib\SwiftMailer\classes\Swift\Mime\SimpleMimeEntity.php(454): Swift_Mime_SimpleMimeEntity->toString() #5 Z:\home\ave-okna.ru\www\lib\SwiftMailer\classes\Swift\Mime\SimpleMessage.php(537): Swift_Mime_S in Z:\home\ave-okna.ru\www\lib\SwiftMailer\classes\Swift\ByteStream\FileByteStream.php on line 126
Replacement
if (!$this->_reader = fopen($this->_path, 'rb')) {
to
if (empty($this->_path))
return null;
if (!$this->_reader = fopen($this->_path, 'rb')) {
does not work
How to get out of this situation?The latest version of the same problem.
The text was updated successfully, but these errors were encountered: