elisp で XML-RPC を介してファイル (PNG 画像) からバイナリ データのブロブを転送しようとしています。これは、Confluence wiki への添付ファイル (特に現在のページで使用されているローカル画像) の自動アップロードの一部です。これを行うコードは次のとおりです。
;; Open the file and get content
(with-temp-buffer
;; file-name is the PNG file name, which is binary data
(find-file (expand-file-name file-name current-dir))
;; Setup Confluence request alist
(setq confl-req (list
(cons "fileName" file-name)
(cons "contentType" mime-type)))
;; RPC call
(setq confl-reply (cfln-rpc-execute 'confluence1.addAttachment
page-id confl-req (buffer-substring-no-properties (point-min) (point-max))))
作品に問題があり(buffer-substring-no-properties (point-min) (point-max))
ます。Confluence にアップロードされたバイナリ データは、いくつかの場所で PNG ファイルと一致しません。添付ファイルのバイト0xe0 0x88
が に置き換えられていることに気付きました。0xc8
ファイルに含まれる正確なバイナリ データを取得する方法はありますか?
ありがとう、NMA