Skip to Content
Menu
This question has been flagged
2 Replies
3994 Views

I have config FTP in my local system. I have put one CSV file into one folder now I can get the CSV file and create the attachment to that CSV file so how can I attach that CSV file. I have some code about connect with FTP file.  but no idea how to get and attach in attachment or direct download that file


path = '/home/Demo/FTP/Test/'
filename = 'PE_20180727093212.csv'

ftp = ftplib.FTP("127.0.0.1")
ftp.login("demo", "demo")
ftp.cwd(path)
ftp.retrbinary("RETR " + filename, open(filename, 'wb').write)
ftp.quit()
Avatar
Discard

Did u find out the proper answer for how to attach the FTP file in odoo?

Best Answer

Hello Harshit,

you need to fetch the attach file from the FTP and store into the Attachment(ir.attachment object). Then you can download it directly

Avatar
Discard
Related Posts Replies Views Activity
1
Mar 21
9338
0
Feb 18
3065
0
Nov 19
1935
0
Jul 19
1803
0
Mar 18
2337