コード例 #1
0
    def _build_empty_file_query(self, files):
        info = FileCreationInformation()
        info.url = self.file_name
        info.overwrite = True

        qry = create_file_query(files, info)
        self.context.after_execute(self._build_upload_session_query)
        return qry
コード例 #2
0
    def upload_file(self, name, content):
        """Uploads a file into folder

        :type name: str
        :type content: str
        """
        info = FileCreationInformation()
        info.content = content
        info.url = name
        info.overwrite = True
        target_file = self.files.add(info)
        return target_file
コード例 #3
0
def _create_empty_file(path):
    file_name = os.path.basename(path)
    info = FileCreationInformation()
    info.url = file_name
    info.overwrite = True
    return info