thanks for your answer first ! but i can NOT determine the detail path because the user's environment will be very different.regards!
try { Map map = HttpUtil.getUploads(request); ByteArrayDataSource ds = (ByteArrayDataSource)map.get("map_file_name"); if (ds == null || ds.getBytes() == null) { return; }FileOutputStream fo = new FileOutputStream("/tmp/map.gif"); fo.write( ds.getBytes() ); fo.flush(); fo.close(); } catch (Exception ex) { throw new ServletException(ex); }then the file is uploaded into /tmp successfully. However the /tmp is NOT under the webapp context so that the following code will not work:(<image xlink:href="/tmp/map.gif" x="0" y="0" width="100%" height="100%" onmouseover="hideMenu(evt);"/>then how to replace map.gif in a webapp ???
home/tom/jboss3.2.1_tomcat4.1.24/server/default/tmp/deploy/server/default/deploy/omnet-web.war/57.omnet-web.war!/imagesThe above is the directory from exception.This directory point to the temp directory of jboss. And of course the "map.gif" is not in there ,right? I think the "/tmp" is in your web server , right? So you just need to get this file from web server but not the client.
>>think the "/tmp" is in your web server , right? So you just need to get this file from web server but not the client.Because jboss deploys war directly,i really donot know where /tmp is in my web server.This is same as images/map.gif !regards!
Map map = HttpUtil.getUploads(request);
ByteArrayDataSource ds = (ByteArrayDataSource)map.get("map_file_name");
if (ds == null || ds.getBytes() == null) {
return;
}FileOutputStream fo = new FileOutputStream("/tmp/map.gif");
fo.write( ds.getBytes() );
fo.flush();
fo.close();
}
catch (Exception ex) {
throw new ServletException(ex);
}then the file is uploaded into /tmp successfully. However the /tmp is NOT under the webapp context so that the following code will not work:(<image xlink:href="/tmp/map.gif" x="0" y="0" width="100%" height="100%" onmouseover="hideMenu(evt);"/>then how to replace map.gif in a webapp ???