|
In the latest Pharo 7 64 bit build running on MacOS the following fails:
<code>ZnMimePart fieldName: 'file' fileNamed: '/path/to/aPdfFile.pdf'</code>
In this method an instance of a ZnCharacterReadStream receives the message #binary which it not understands.
I would suggest the following fix:
<code>fieldName: fieldName fileNamed: fileName | mimeType size fileStream entity baseName | mimeType := ZnMimeType forFilenameExtension: (ZnFileSystemUtils extensionFor: fileName). fileStream := mimeType isBinary ifTrue: [ fileName asFileReference binaryReadStream ] ifFalse: [ fileName asFileReference readStream ]. size := ZnFileSystemUtils fileSizeFor: fileName. (entity := ZnStreamingEntity type: mimeType length: size) stream: fileStream. baseName := ZnFileSystemUtils baseNameFor: fileName. ^ self fieldName: fieldName fileName: baseName entity: entity</code>
Ok? Then I'll make a PR
|
|
|
Priority: 5 – Fix If Time
|
|
Status: Work Needed
|
|
Assigned to: Everyone
|
|
Milestone: Later
|
Go to Case
|
|