upload.groovy

来自「dojo uploade 源码 一种解决方案」· GROOVY 代码 · 共 20 行

GROOVY
20
字号



def onCreate() {
	//Get the file parameter
	def attachment = request.files["attachment"]
	
	//Get the filename and path 
	def filepathUpload = attachment.path[0]
	def fileName = attachment.filename[0]
	
	int fileSize = new FileInputStream(new File(filepathUpload)).available()
	def msg = "The size of your file '" + fileName + "' is " + fileSize + " bytes."
	
	//Return the HTML with <textarea>
	def iframeData = "<textarea>" + msg + "</textarea>"
	println iframeData
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?