grails 处理上传

HMTL
<g:form action="save" method="post" enctype="multipart/form-data" > 

<input type="file" id="projectLogoPath" name="projectLogoPath" value="${fieldValue(bean:projectInstance,field:'projectLogoPath')}"/>
controller:

def f = request.getFile('projectLogoPath')  
        if(!f.empty) {  
            fileName=f.getOriginalFilename()           
            filePath="web-app/images/" 
            f.transferTo(new File(filePath+fileName) )  
        } 

你可能感兴趣的:(Web,F#,grails)