Last active
July 4, 2018 08:14
-
-
Save akhmadkresna/49d451d10ec616a99556d4a194868aa6 to your computer and use it in GitHub Desktop.
get file name of binary file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- IN PYTHON, ADD ANOTHER FIELD DECLARATION TO STORE FILE NAME (CHAR)--> | |
file = fields.Binary("Attachment") | |
file_name = fields.Char("File Name") | |
<!-- IN XML VIEW, SET THE 'FILENAME' ATTRIBUTE OF THE BINARY FIELD WITH THE CHAR FIELD (FIELD_NAME)--> | |
<field name="file" filename="file_name"/> | |
<field name="file_name" invisible="1"/> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment