I am using plone to build my site.
In one page template, I have the <input type="file" name="file"> and this form: <form method="post" action="addintoDb" enctype="multipart/form-data"
The addintoDb is a python script that save my information into db:context.addParam(name=request.name, path=request['file']).
in my db i have name and in the path: <ZPublisher.HTTPRequest.FileUpload instance at 0x081F98C8> but i want to have the put where the file was uploaded (like c:...)
您没有将文件保存在文件系统上,而是保存在 Zope 对象数据库中。您必须使用 python 代码(而不是 python 脚本)使用 open 内置函数打开文件路径来保存数据。
You are not saving the file on the filesystem, but in the Zope object database. You'd have to use python code (not a python script) to open a filepath with the open built-in function to save the data to.
发布评论
评论(1)
您没有将文件保存在文件系统上,而是保存在 Zope 对象数据库中。您必须使用 python 代码(而不是 python 脚本)使用
open
内置函数打开文件路径来保存数据。You are not saving the file on the filesystem, but in the Zope object database. You'd have to use python code (not a python script) to open a filepath with the
open
built-in function to save the data to.