0
在我的項目中,我使用request.FILES.getlist('filedname')
接收多個文件並使用django forms save
方法保存它。使用python的tika
服務器API再次讀取相同的文件:將django文件對象放入蒂卡服務器
def read_by_tika(self, path):
'''file reading using tika server'''
parsed = parser.from_file(str(path))
contents = (parsed["content"].encode('utf-8'))
return contents
有沒有什麼辦法直接把列表文件從獲取到request.FILES
服務器tikka
而不保存在硬盤中。
您是不是指[Apache Tika](https://tika.apache.org/)?請添加一個鏈接到'read_by_tikka()'API文檔。 – Udi
是Apache Tika – akhilviswam
def read_by_tikka(self,path): '''使用tika服務器讀取''' parsed = parser.from_file(str(path)) contents =(parsed [「content」]。encode( 'utf-8')) return contents @ Udi – akhilviswam