orgid = await get_userorgid()
dbname = get_module_dbname('filemgr')
db = DBPools()
async with db.sqlorContext(dbname) as sor:
	filemgr = RagFileMgr()
	if params_kw.filetype == 'folder':
		has_sub = await filemgr.has_sub(sor, params_kw.id)
		if has_sub:
			return UiComform(title='Delete Conform', 
						message='This folder has subitem, are you sure to delete it?', binds=[
						{
							"wid":"self",
							"event":"conformed",
							"actiontype":"urlwidget",
							"target":"self",
							"options":{
								"params":{
									"id":params_kw.id,
									"filetype": params_kw.filetype
								},
								url: entire_url('conformed_delete.dspy')
							}
						}
					])
		await filemgr._del_folder(sor, params_kw.id, ownerid)
	else:
		await filemgr._del_file(sor, params_kw.id, ownerid)
	return UiMessage(title='delete file', message='delete success')
return Error(title='delete file', message='delete failed')
