jsf - how to get a file's full path using -
jsf - how to get a file's full path using <p:fileUpload> -
i'm having problem fullpath of file upload using primefaces component . code:
<h:form prependid="false" enctype="multipart/form-data"> <p:fileupload update="@form" mode="advanced" auto="true" fileuploadlistener="#{mybean.myfileupload}"/> <h:outputtext value="#{mybean.filename}"/> </h:form> @managedbean @sessionscoped public class mybean { private string filename; public void myfileupload(fileuploadevent event) { facesmessage msg = new facesmessage("succesful", event.getfile().getfilename() + " uploaded."); facescontext.getcurrentinstance().addmessage(null, msg); filename = event.getfile().getfilename(); } public string getfilename() { homecoming filename; } public void setfilename(string filename) { this.filename = filename; } }
i file's name want total path. seek doesn't show anything.
filename = filenameutils.getfullpath(event.getfile().getfilename());
what expect fullpath of uploaded file? browser sent bytes, in memory of servletcontainer , stored. there no fullpath /var/tmp/myfile.txt
.
jsf file-upload primefaces
Comments
Post a Comment