Hi, I am trying to add my ebook to calibre content server by sending post request with python. And here is the code.
https://gist.github.com/Nriver/7b62d...97d16226d3da3a
This worked and calibre server did get the new book. However, when I compare the ebook file in the calibre server and the original one, I found the file content is little bit wrong. The form information was on the top of the file. Please see the attachment image.
If I upload it with Chrome manually, this won't happen. I am wondering whether there is something wrong with my code.
I had read some of the calibre source code.
In the cdb.py file, there is a line 'rd.request_body_file.seek(0)', could this be cause of the problem? Maybe the real file content should start with some offset?
P.S.
'ctx' stands for context, and what is 'rd' stand for? I see them a lot in the server code.