Odoo Help


How to upload binary file to ftp from python

on 5/24/13, 4:38 AM 5,133 views

Hi, I need to upload the binary file to ftp automatically from pyhton how can i achieve this?


ClueLogics Technologies Pvt. Ltd.

--ClueLogics Technologies Pvt. Ltd.--
| 6 5 8
Delhi NCR, India
--ClueLogics Technologies Pvt. Ltd.--

 ClueLogics Technologies Pvt Ltd is a Software product and services provider. We are positioned to deliver robust, rapid and reliable Information Technology solutions that work. What we succeed upon is Technology and Technical Expertise. The industry review of ClueLogics has been commendable for the past years as most of its business comes from repeat orders by highly satisfied clients.

ClueLogics Technologies Pvt. Ltd.
On 5/24/13, 4:54 AM

Hi Maniganda

you can like below

import some class in your .py file

from ftplib import FTP

objec.storbinary('STOR yourfile.txt', open('yourexixtingfile.txt', 'rb'))

After successfull login

use properties of objec object such as upload reload ,read file from etc...... hope this is help you just see the objec FTP's method you can it easily


Thanks for your Reply Sandeep , but i am getting the error as gaierror: [Errno -2] Name or service not known

on 5/24/13, 5:26 AM

try to check your FTP user and password

ClueLogics Technologies Pvt. Ltd.
on 5/24/13, 8:18 AM

Davide Corio

--Davide Corio--

| 5 4 7
Bricherasio, Italy
--Davide Corio--

Odoo Evangelist and Consultant

Davide Corio
On 5/24/13, 4:56 AM

you can use the built-in ftp library (http://stackoverflow.com/questions/12613797/python-script-uploading-files-via-ftplink text) or you can avoid using ftp and trying via xml-rpc that's a more stable solution IMO.

If you need to understand how to deal with xml-rpc, you can look at the official docs here:


do not forget that XML-RPC cannot manage binary files as-is, you'll have to read the content and convert it into a base64 string.

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 5/24/13, 4:38 AM
Seen: 5133 times
Last updated: 3/16/15, 8:10 AM