将文件上传到ever note后,所有文件都以相同的名称显示

  • 本文关键字:文件 显示 ever note evernote
  • 更新时间 :
  • 英文 :


我创建了一个文件的副本,名称为a.pdf、B.pdf、C.pdf(不同名称的相同文件)。在我将这些文件上传到ever note后,所有文件都显示为相同的名称。(A.pdf,A,pdf,A.pdf)

我已经在Evernote网络应用程序中检查过了。

要更改Evernote中显示的文件名(以及下载时),请使用note属性对象并将fileName属性设置为文件名。然后,通过将资源对象的attributes属性设置为ResourceAttribute对象,将noteAttribute对象附加到资源。

Python中的示例:

import evernote.edam.type.ttypes as Types
#create the resource object
resource = Types.Resource()
resource.data = data
#get the hash to reference in ENML
hash_hex = binascii.hexlify(fileHash)
#write note contents
note.content = '<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml2.dtd"><en-note><br/>Excel File:<en-media type="application/excel" hash="' + hash_hex + '"/></en-note>'
#create Resource Attribute Object
ra = Types.ResourceAttributes()
ra.fileName = "report.xlsx" #set the filename you wish to appear in the note
ra.attachment= True
#attach the resource attribute object to the resource object
resource.attributes = ra
note.resources = [resource] # Now, add the new Resource to the note's list of resources

相关内容

最新更新