Hello every one here i am again, Does anyone knows how to display filename of a binary file? I tried to make it downloadable but upon the execution of the wizzard it shows only the "Download" without its filename and upon downloading it's filename become the name of my class plus there is no file extension. The downloaded file is something like this: custom_report_1 (i want to bear it's filename base on how i set it and it's extension). How can i resolve this? Pls help.
You have to create a char field and then link it with binary field in xml file using filename attribute.
# create a char field
file_data = fields.Binary('File')
file_name = fields.Char('File Name')
# Go to xml and
<field name="file_data" filename="file_name"/>
<field name="file_name" invisible="1"/>
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
About This Community
|Asked: 12/3/14, 10:54 PM|
|Seen: 550 times|
|Last updated: 8/8/16, 1:55 AM|