I am trying to upload a video file to Openstack container using REST API. This is my Python code to upload to the server.
res = requests.put(publicURL+'/'+output_container_name+'/'+toUpload,
headers={'X-Auth-Token': token},
files={'file': open(toUpload,'rb')})
All the variables that you see in code are defined. In fact I can see my file uploaded to the container but when I download it, I cannot play the video. When I open the video file with a text editor I see these headers at the beginning and at the end of the file.
--0b2e78b52dad4b45a43575c1c42b0b9d
Content-Disposition: form-data; name="file"; filename="input_output.mp4"
.
.
. Normal video content
.
.
--0b2e78b52dad4b45a43575c1c42b0b9d--
How can I get rid of these header in the file?
EDIT: Even when I remove the headers manually there is still some differences in the files when I check them with diff. The Differences are not visible visually the number of lines are the same and everything look the same.