0

I have a field to upload a file to my form. Now I want to be able to view it without downloading the file (it's a photo and no editing of the file is required). When I do download the file I would like to have it keep its original name instead of being renamed to a generic name (ex. original_name.* stays original_name.* instead of becoming serial_number_22.*).

I have the following.

In my .py file:

'file_upload' : fields.binary('Sales Contract'),

In my .xml file:

<field name="file_upload"/>

With kind regards,

4

2 回答 2

0

请看一下这个模块文档管理系统。这有助于您上传文件并将其关联到各个记录。在知识菜单下,您可以单独组织、查看、共享文件和文件夹,通过 ftp 共享也是一个附加选项。

如果您的目的不同,我很抱歉。我想这可能会对你有所帮助。

于 2013-08-16T16:15:17.377 回答
0

如果是图片,widget="image"上传后可以直接使用查看。

于 2013-08-19T10:04:41.790 回答