Total members 11797 |It is currently Sun Sep 22, 2019 12:28 am Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





Hi, everybody.
i want to get file name from html file input form using jsp.

my codes are followed as:

Code:
    <table>
        <tr>
            <td >
             <input type="file" id="csvfilebrowse" name="csvfilebrowse" style="width:400px; height:20px" onChange="getfilename();">
             
         <script type="text/javascript">
            // <![CDATA[
           
            function getfilename() {
                var v_csvfileName = '';
                [b]v_csvfileName[/b] += document.getElementById('csvfilebrowse').value;
            };
         // ]]>
            </script>
          </td>
           
        </tr>
        <tr>
            <td align="left">
            <%   
               Workbook workbook = null;
               Sheet sheet = null;
               String csvFileName = [b]v_csvfileName;[/b]
               // Reading Test
               //Workbook workbook = Workbook.getWorkbook(new File(file_path+"/reportToExcel.xls"));
               workbook = Workbook.getWorkbook(new File(csvFileName));
               sheet = workbook.getSheet(0);
               for(int i=0;i<sheet.getColumns();i++){
                  Cell a1 = sheet.getCell(i,0);
                  String stringa1 = a1.getContents();
               }
                 %>
            </td>
        </tr>
    </table>



here, what i want to get, how to convert the filename variable named v_csvfileName of javascript to the filename named csvFileName of jsp.

please kindly help me.
thank you.




Author:
Newbie
User avatar Posts: 1
Have thanks: 0 time
Post new topic Reply to topic  [ 1 post ] 

  Related Posts  to : getting file name of html input file tag using jsp
 Google Chrome input file     -  
 Encrypt/Decrypt a file from source file to target file.     -  
 read php file in asp and display it as html     -  
 PHP HTML form with to file upload     -  
 insert information in html file with java     -  
 Copy file to file in java code- implementation     -  
 file descriptor vs file pointer     -  
 How to convert xml file to Pdf file using C     -  
 C++ File I/O     -  
 web.xml file     -  









Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com