How do you set the encoding on the FolderItem that the response is directly downloaded to in the HTTPSocket DownloadComplete event?
Similarly, when sending a picture as a binary data attachment using HTTP POST, do you need to use DefineEncoding? The picture data is stored in the database as string and is retrieved using StringValue.
If the file is being download directly into a FolderItem then the text encoding is not important until you open the file for reading. The Read method of classes like BinaryStream and TextInputStream accepts an optional second parameter for defining the text encoding.
When sending binary data like a Picture, then no text encoding should be used at all (since it’s not text.)
I use LoadXML on the file, but I noticed there’s no parameter for encoding. I guess that’s because it takes it automatically from the xml prolog line?
[quote=207882:@Andrew Lambert]
When sending binary data like a Picture, then no text encoding should be used at all (since it’s not text.)[/quote]
Ok, the attachment is, but when doing a multi part POST, do you have to set the encoding on the different parts of the POST that are not the attachment itself?
The encoding of individual parts of a multipart/form-data message can be set in the part’s Content-Type header, as the CharSet parameter. For example, setting the encoding of a multipart form’s file part to UTF-8: