Multi-part file encoding requires types that allow buffer interface

"TypeError: 'long' does not have the buffer interface" fixed for multi-part file encoding.