Hello!
I tried to adapt the script from post 13 to my task. But as a result, I get a file with an image, before which there is a piece of HTML code. In the logs we can see:
As we can see, the authorization on the camera does not pass, but I still get the image. In order to view it, I only need to remove the html header.
So, I have to edit the image before sending it by mail. The solution is simple, but I think it is not quite right
How to solve the problem correctly?
Thanks!
I tried to adapt the script from post 13 to my task. But as a result, I get a file with an image, before which there is a piece of HTML code. In the logs we can see:
Code:
stest 25.02.2019 13:44:51
* string: <!DOCTYPE html>
<html><head><title>Document Error: Unauthorized</title></head>
<body><h2>Access Error: 401 -- Unauthorized</h2>
<p>Authentication Error</p>
</body>
</html>
����
As we can see, the authorization on the camera does not pass, but I still get the image. In order to view it, I only need to remove the html header.
So, I have to edit the image before sending it by mail. The solution is simple, but I think it is not quite right
Code:
a1, a2 = string.find(image,"</html>\r\n")
image = string.sub(image, a2+1)
How to solve the problem correctly?
Thanks!