Ok, this is totally random and not really Lucee-specific; but, y’all are smart people! I’m trying to hand craft a multipart/form-data
post. Essentially, generate the body
without any of the file-based CFHttpParam
entries. To give you a sense of what I mean, I have something like this:
lines = [
'-------------------------------7d0d117230764',
'Content-Disposition: form-data; name="file"; filename="/Users/bennadel/Sites/testing-lucee/multipart/blob.data"',
'Content-Type: application/octet-stream',
'',
charsetEncode( binaryData, "utf-8" ),
'-------------------------------7d0d117230764--',
''
];
// Collapse the lines down to a body payload.
body = lines.toList( newline );
If binaryData
has no signed bytes, everything appears to be fine. But, the moment that binaryData
has any signed-bytes, the data is correupted on the way over.
Google is not helping me. The best I can understand is that the multipart/form-data
protocol uses 7BIT
encoding, which I think means it ??? ignores the sign-bit ??? Not really sure.
I tried using us-ascii
as the charsetEncode()
encoding, but that doesn’t work either.
Anyone have any ideas at all? I’ve poured about 6-hours into this so far and cannot get it work without corrupting the data.