コード例 #1
0
ファイル: dbuploader.py プロジェクト: gisweb/plomino.pgfiles
    def removeFileAttachment(self):
        """
            rimuove un file dal database
        """

        if not self.doc.isReader():
            return None

        if not (self.element and isfloat(self.element)):
            return None
        fileid = int(self.element)

        removeFile(self.doc, fileid)
コード例 #2
0
    def removeFileAttachment(self):
        """
            rimuove un file dal database
        """



        if not self.doc.isReader():
            return None

        if not (self.element and isfloat(self.element)):
            return None
        fileid = int(self.element)

        removeFile(self.doc,fileid)
コード例 #3
0
ファイル: dbuploader.py プロジェクト: gisweb/plomino.pgfiles
    def getFileAttachment(self):
        """
            carica un file dal database
        """

        if not self.doc.isReader():
            return None

        if not (self.element and isfloat(self.element)):
            return None
        fileid = int(self.element)

        dbfile = getFile(self.doc, fileid)
        if not dbfile:
            return None

        self.request.RESPONSE.setHeader("content-type", dbfile.file_type)
        self.request.RESPONSE.setHeader("Content-Disposition", "inline; filename=" + dbfile.file_name)
        return base64.b64decode(dbfile.file_content)
コード例 #4
0
    def getFileAttachment(self):
        """
            carica un file dal database
        """

        if not self.doc.isReader():
            return None

        if not (self.element and isfloat(self.element)):
            return None
        fileid = int(self.element)

        dbfile = getFile(self.doc,fileid)
        if not dbfile:
            return None
            
        self.request.RESPONSE.setHeader(
                'content-type', dbfile.file_type)
        self.request.RESPONSE.setHeader(
                "Content-Disposition", "inline; filename=" + dbfile.file_name)
        return base64.b64decode(dbfile.file_content)