eventszkzul

Getting a full file path from Fileupload in zk


I want Absolute Path but it's get eclipse path. how to get original path please help me.

<zk>
  <window title="Hello World!!" border="normal">
    <label value="You are using: ${desktop.webApp.version}" id="lab" />
    <textbox id="tex" width="250px" />
    <button label="Upload Image" upload="true,maxsize=300">
      <attribute name="onUpload">
        <![CDATA[
          org.zkoss.util.media.Media media = event.getMedia();
          java.io.File myFile = new java.io.File(media.getName());
          Messagebox.show("path"+myFile.getAbsolutePath());
        ]]>
      </attribute>
    </button>
  </window>
</zk>

Solution

  • Now browsers have a very high security so it preventing to show client local file system and for security it make sense for everyone ,no any internet user will like Server will know the our local file system if still any browser showing your file system in browser it is lake of security in the browser.