English 中文(简体)
plone.app.blob or z3c.blobfile?
原标题:

I need a blob file field as part of a content type in plone. plone.app.blob s BlobField should provide this, but I can t find how to get a URL to download the file including the original filename (e.g. http://plone.site/plone/obj/orig-file-name.avi). Is there a way to do this using plone.app.blob?

Alternately, there are a few pointers on the web pointing to plone.namedfile to do this. plone.namedfile seems to rely on z3c.blobfile. How does z3c.blobfile differ from plone.app.blob?

Is one of these methods better than the other?

vik

最佳回答

If you want to download the file using the original filename, you ll need a few more pieces:

  1. Make sure you put primary=True in the field s settings in the schema.

  2. Make sure your content type s class subclasses plone.app.blob.content.ATBlob, which provides an index_html method that downloads the primary field.

  3. Make sure you add your content type s portal_type to the typesUseViewActionInListings list in portal_properties/site_properties.

plone.namedfile provides a file field that can be used with the z3c.form library. It is indeed based on z3c.blobfile, which provides a similar interface to the file object from zope.app.file. This is probably not what you want if you re building an Archetypes-based content type.

问题回答

暂无回答




相关问题
How to go from uml to app in zope (plone)

I have watched this keynote that talk about develop an app based on an UML model, but I can t find any tutorial or docs about it. Do you know any tutorial or documentation to help me? thanks

Install Plone egg as a Python module on Windows

I have a Plone site (Plone version 3.1.2) that I need to install a product called GrufSpaces on - (http://plone.org/products/grufspaces). However, it is a production site and so I can t easily take it ...

Plone with Apache Proxy

I have a plone zinstance set up through Apache Proxy on OS X Server 10.5. The server is set up with a single vhost on port 80, with Proxy & Proxypass directives to the Plone zinstance: ...

Zope / Plone 3 product uninstsall issue

Hey all, I uninstalled a content type that I d previously added and afterward I m still getting a warning of 2010-01-06 22:43:50 WARNING OFS.Uninstalled Could not import class myclass from module ...

plone.app.blob or z3c.blobfile?

I need a blob file field as part of a content type in plone. plone.app.blob s BlobField should provide this, but I can t find how to get a URL to download the file including the original filename (e.g....

Moving (very old) Zope/Plone Site to Django

I am ask to move data from a (now offline) site driven by Plone to a new Django site. These are the version informations I have: Zope Version (unreleased version, python 2.1.3 ) Python Version 2.1....

热门标签