This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

email with attachement gives image size 0
#15
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:
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 Wink

Code:
a1, a2 = string.find(image,"</html>\r\n")
image = string.sub(image, a2+1)

How to solve the problem correctly?
Thanks!
Reply


Messages In This Thread
RE: email with attachement gives image size 0 - by Igori - 25.02.2019, 10:58

Forum Jump: