Re: Would DirectoryStorage be able to extract attachments (Word, PDFs etc) from data.fs...?

Toby Dickenson <[email protected]> Thu, 22 Jun 2006 13:48:54 +0100
Newsgroups gmane.comp.web.zope.zodb.dirstorage
Message-ID <[email protected]>
On Thursday 22 June 2006 00:13, michael nt milne wrote:
> Hi
> 
> I'm looking for a way of taking a data.fs file and extracting file
> attachments that have been stored within say using Plone etc. I've
> been recommended to check out DirectoryStorage.
> 
> Say for example you have a back-up of your data.fs but would like to
> grab all the Word documents, PDF's, Excel files etc that have been
> uploaded and then write each file to a filesystem location.
> 
> The files written back to the filesystem would have to be accessible
> from outwith the Plone or Zope system. I've experimented with
> ATManagedFile and FileSystemStorage etc and the files with attachments
> embedded there are not recognisable as Word docs, PDFs etc.

DirectoryStorage does not use its files that way. Each files stores ZODB 
object pickles, not 'attachments'.

You might be able to derive the original attachment content by stripping off 
the DirectoryStorage file header, then the ZODB header, then unpickling. That 
is assuming you knew which file to look in (filenames are ZODB oids), and 
assuming that your ZODB application uses one pickle per attachment.

Thats all very doable from a disaster recovery point of view, but probably not 
acceptable if you are looking for a *convenient* sync between Plone and 
filesystem content.

I hope this helps,


____________________

Important Notice:

This email and any attachments are confidential and may contain trade secrets or be legally privileged. If you have received this email in error you must not use, rely upon, disclose, copy or distribute the contents. Please reply to the sender so that proper delivery can be arranged and delete the email from your computer.
Gemini Data Loggers monitor incoming and outgoing email to ensure satisfactory customer service, maintain company security and prevent abuse of their email system. However, any views expressed in this email are not necessarily those of Gemini and Gemini cannot be held responsible for the content.
Gemini makes best efforts to ensure emails are virus free; however you are advised to carry out your own checks. Gemini does not accept responsibility for any damage resulting from email viruses.
____________________


All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642