def themeupload(self): theme_static = get_theme_folder('static') file = request.get_json()['file'] ext = os.path.splitext(file)[-1] if ext in ['.css', '.js']: upload_text_file(theme_static, file) else: upload_binary_file(theme_static, file) return 'Theme file uploaded'
def fileupload(self): file = request.get_json()['file'] upload_binary_file(current_app.static_folder, file) return 'File uploaded'