posted 15 years ago
Hi in my application i am browsing for a file and reading its content i can possibly do this in IE where as when i run the application in Firefox it do not give me the complete path of file and while i try to read its contents it says cannot find the file specified
Example.jsp
[code]
--------------------------------------------------------------------------
<form name="FAForm1" method="get" action="">
Select A File To Upload.
<input type="file" name="xls_filename" id="fileselect" onchange="getFileName();">
</form>
---------------------------------------------------------------------------
Example.js
[code]
--------------------------------------------------------------------------
function getFileName()
{
var xls_filename=document.FAForm1.xls_filename.value;
alert(xls_filename);
mygrid1.loadXML("../../FileUPLoad?xls_filename="+xls_filename);
mygrid2.clearAll();
}
--------------------------------------------------------------------------
here when i alert the file name in IE it gives me the complete path of file
"c:\samplefolder\Book1.xls" where as in Firefox it just gives me "Book1.xls" and display an error
Book1.xls
java.io.FileNotFoundException: Book1.xls (The system cannot find the file specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(Unknown Source)
at java.io.FileInputStream.<init>(Unknown Source)
at excelread.FAFilePopulate.doGet(FileUPLoad.java:38)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
at java.lang.Thread.run(Unknown Source)
[ October 26, 2008: Message edited by: ruquia tabassum ]
[ October 26, 2008: Message edited by: ruquia tabassum ]