Reputation: 1608
In a Plone's File content type, which property stores the file's original filename?
I'm using plone.jsonapi.routes to upload files to a plone instance. I can set the id
ant the title
but I can't set the associated file's filename.
For example, when I upload a file to Plone in the regular way, I can set its id
and title
, but additionally to that, the original file name is stored somewhere. You can see it here:
objects-essay.pdf - PDF document
indicates the name the original file has.
But when I upload it with plone.jsonapi.routes that field is empty. So, I'm trying to figure it out which property stores the name to pass it to the api or to set it by hand.
Thanks.
Upvotes: 1
Views: 464
Reputation: 2876
IIRC, all Archetypes-based content types have a setFilename method that you can use to do this.
On Dexterity-based content types file's content is stored in blobs in the ZODB (instances of NamedBlobFile) and there's a parameter named filename
that you can use to set it.
You can see an example of the later in plone.app.contenttypes.
Upvotes: 3