Total members 9946 | Gratitudes |It is currently Thu Feb 09, 2012 3:03 am Login / Join Codemiles


All times are UTC [ DST ]




Post new topic Reply to topic  Quick reply  [ 1 post ] 
Author Question
 Question subject: getting file name of html input file tag using jsp
PostPosted: Mon Dec 07, 2009 10:19 am 
Offline
Newbie
User avatar

Joined: Mon Dec 07, 2009 10:11 am
Posts: 1
Has thanked: 0 time
Have thanks: 0 time

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.


TOP
 Profile Send private message  
Reply with quote  
Post new topic Reply to topic Quick reply  [ 1 post ] 
Quick reply


  


 Similar topics
 Topic title   Forum   Author   Comments 
 Configuring the header html font  HTML examples  msi_333  0
 multi-frameset and non-re-sizable html frame pages  HTML examples  msi_333  0
 What are PHP,PSD to HTML ?  PHP  johnmccem  5
 dfn html tag usage  HTML examples  msi_333  0
 del html tag usage  HTML examples  msi_333  0

All times are UTC [ DST ]


Users browsing similar posts

Users browsing this forum: Google Adsense [Bot] and 2 guests



Jump to:  
Previous Question | Next Question 




Home
General Talks
Finished Projects
Code Library
Games
Tutorials

Java
C/C++
C-sharp
php
Script
JSP/Servlets
Ajax
ASP/ASP.net
Google SEO
Database
Communications
Phpbb3 styles
Photoshop tutorials
Flash tutorials
Find a job






Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team