moaiamorfo ha scritto:
Forse getFile().read() funziona se hai FileSystemStorage installato.


devo installarlo necessariamente? quali benefici apporta? ma poi il
file sul filesystem sarebbe accessibile a tutti (anche a utenti
anonimi), conoscendone l'URL?

forse il campo non si chiama "file" per cui getFile non legge nulla?


sì si chiama "file", se vado di self.getFile().read() ho AttributeError su read.
leggi sotto :)



--On 11. April 2008 14:19:49 +0200 Luca Bel <luca...@gmail.com> wrote:

Hi all.

I have an ATFile derived content type and need to save the associated file
in the filesystem

I try to use something like:

            fh = open(self._myPath,' wb ')
            fh.write(e.getFile().read())
            fh.close()


But in this mode I get: *** AttributeError: read


I think there is no documentation that indicates that getFile() returns a filestream object - so don't invent code and don't guess :-)

str(fileobject.getFile().data)

should work.




_______________________________________________
Plone-IT mailing list
Plone-IT@lists.plone.org
http://lists.plone.org/mailman/listinfo/plone-it
http://www.nabble.com/Plone---Italy-f21728.html

Rispondere a