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.

E-mail with attachment
#12
(15.03.2017, 10:46)admin Wrote: You don't need that strange repeat loop. Wget is blocking, it does not background while downloading so when os.executes return file must be there unless there's an error with connection or file is not found on the remote server.

But I had such situation:
especially when I try download few files and after this I want immediately send them via email. Email was sent but with only a part of images(not fully loaded). Firstly I've added some intuitive os.sleep(n) (intuitive because it depends on size of file and on available bandwith) but after I've prepared this solution which start download an image, check if download is finished and then it returns full-loaded file and its path. When I am using this solution I didn't have some problem with not fully-loaded file sent via email.

But also when I've used Erwin example sometimes I had a problem with not-fully loaded images attached to an email. The solution was adding some os.sleep(n) after os.execute() (normally for camera snapshot 400kB 1-2s).
Reply


Messages In This Thread
E-mail with attachment - by admin - 21.09.2016, 06:34
RE: E-mail with attachment - by buuuudzik - 11.03.2017, 07:29
RE: E-mail with attachment - by buuuudzik - 15.03.2017, 09:35
RE: E-mail with attachment - by admin - 15.03.2017, 10:46
RE: E-mail with attachment - by buuuudzik - 15.03.2017, 11:00
RE: E-mail with attachment - by admin - 15.03.2017, 11:06
RE: E-mail with attachment - by buuuudzik - 15.03.2017, 11:12
RE: E-mail with attachment - by Keitz - 22.10.2017, 18:11
RE: E-mail with attachment - by buuuudzik - 17.03.2017, 16:59
RE: E-mail with attachment - by buuuudzik - 22.10.2017, 18:24
RE: E-mail with attachment - by iJAF - 06.04.2022, 17:31
RE: E-mail with attachment - by admin - 11.04.2022, 09:44

Forum Jump: