# Default Binary Image

**URL:** https://discuss.tryton.org/t/default-binary-image/2000
**Category:** Developer
**Created:** [November 26, 2019, 5:40am UTC](https://discuss.tryton.org/t/default-binary-image/2000 "2019-11-26T05:40:23Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Rajasekhar](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/rajasekhar/32/544_2.png) [@Rajasekhar](https://discuss.tryton.org/u/Rajasekhar)
#### Post date: [November 26, 2019, 5:40am UTC](https://discuss.tryton.org/t/default-binary-image/2000/1 "2019-11-26T05:40:24Z")

</div>

Hello.  
I have given a test.svg as a default image for the binary field.  
The picture gets displayed in my localhost but when I push the code to the server, it throws an error saying the “test.svg” file not found.  
How do I rectify this?

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [November 26, 2019, 8:56am UTC](https://discuss.tryton.org/t/default-binary-image/2000/2 "2019-11-26T08:56:39Z")

</div>

Probably that the `test.svg` file is not installed by your deployment. Is it define as `package_data` in your `setup.py`?

---

<div class="post-metadata">

### Author: ![Rajasekhar](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/rajasekhar/32/544_2.png) [@Rajasekhar](https://discuss.tryton.org/u/Rajasekhar)
#### Post date: [November 27, 2019, 5:34am UTC](https://discuss.tryton.org/t/default-binary-image/2000/3 "2019-11-27T05:34:25Z")

</div>

Yes, it is defined in my setup.py as package\_data.

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [November 27, 2019, 8:56am UTC](https://discuss.tryton.org/t/default-binary-image/2000/4 "2019-11-27T08:56:45Z")

</div>

Are you opening it using the `trytond.tools.file_open` function?  
This method should be used because setuptools may put the file in different places depending on your setup, OS etc.

---

<div class="post-metadata">

### Author: ![Thedevilcoder](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/t/ac91a4/32.png) [@Thedevilcoder](https://discuss.tryton.org/u/Thedevilcoder)
#### Post date: [December 2, 2019, 7:11am UTC](https://discuss.tryton.org/t/default-binary-image/2000/5 "2019-12-02T07:11:19Z")

</div>

I found out that there are no files or folders related to my module in my trytond/modules directory

 ![Screenshot%20from%202019-12-02%2013-07-52](https://discuss-cdn.tryton.org/uploads/default/original/1X/4d0d120958bf88b8a0666c9ec4d757218e573ff9.png)

The images are in this folder

 ![Screenshot%20from%202019-12-02%2013-09-30](https://discuss-cdn.tryton.org/uploads/default/original/1X/bb201debc1c38d9947727f4eb611a81a9398111b.png)

But I can’t open from here because of the secure\_join function of file\_open and the root that file\_open takes is _location of python virtual environment_/lib/python3.6/site-packages/trytond-5.0.6-py3.6.egg/trytond

Please help

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [December 2, 2019, 9:12am UTC](https://discuss.tryton.org/t/default-binary-image/2000/6 "2019-12-02T09:12:31Z")

</div>

The files used by a module must be installed inside this module. So I suspect that the `package_date` is not correctly setup such that the installation put them in the module.

---

<div class="post-metadata">

### Author: ![kakamble](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/kakamble/32/494_2.png) [@kakamble](https://discuss.tryton.org/u/kakamble)
#### Post date: [December 2, 2019, 10:18am UTC](https://discuss.tryton.org/t/default-binary-image/2000/7 "2019-12-02T10:18:23Z")

</div>

The package\_data for this module is as follows

![Screenshot_20191202_145258](https://discuss-cdn.tryton.org/uploads/default/original/1X/28d18e1b7940acd3008ce812c97e13b8b1e0f0ec.png)

---

<div class="post-metadata">

### Author: ![edbo](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/e/f14d63/32.png) [@edbo](https://discuss.tryton.org/u/edbo)
#### Post date: [December 2, 2019, 12:56pm UTC](https://discuss.tryton.org/t/default-binary-image/2000/8 "2019-12-02T12:56:57Z")

</div>

The location seems a bit weird to me.

> [@Thedevilcoder](#):
>
> _python virtual environment_ /lib/python3.6/site-packages/trytond-5.0.6-py3.6.egg/trytond

Shouldn’t this be _python virtual environment_ /lib/python3.6/site-packages/trytond ? This is where all my tryton data lives is.

---

<div class="post-metadata">

### Author: ![Thedevilcoder](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/t/ac91a4/32.png) [@Thedevilcoder](https://discuss.tryton.org/u/Thedevilcoder)
#### Post date: [December 3, 2019, 7:19am UTC](https://discuss.tryton.org/t/default-binary-image/2000/9 "2019-12-03T07:19:05Z")

</div>

I finally solved this problem

The path to be given is _module\_name_/_path\_to\_test.svg\_relative\_to\_module\_name_
