我正在为我的项目使用django-ipfs-storage
模块,并希望将文件上传到InterPlanetaryfilesystemStorage()
模型字段。但是,如果我仅上传pdf文件,则可以成功上传,但是在加密文件后上传时,仅存储前4096个字节,其余的不存在。
当我尝试在终端上使用ipfs add
命令添加相同的加密文件时,该文件已成功上传。这是用于上传加密文件的代码:
file_ = open(os.path.join(settings.ENCRYPTION_ROOT,str(paper)+'.encrypted'),'rb')
s_file = File(file_)
store = Request.objects.get(tusername=request.user.username)
store.paper.save(str(paper)+'.encrypted',s_file,save=True)
我到处搜索过,但在这方面仍然没有任何帮助。