It is currently Fri Jul 30, 2010 2:09 pm


All times are UTC [ DST ]


Ask on Codemiles community and get answers Free and Fast :

JSP/Servelts codes,JSP/Servelts tricks ,JSP/Servelts faq ,JSP/Servelts answers .and more

Our guest share with us your code snippets , your programming problems , your open source projects ,read articles and post yours .







Post new topic Reply to topic  [ 1 post ] 
  Print view Previous topic | Next topic 
Author Message
 Post 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  
 
| More
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 


 Similar topics
 Topic title   Forum   Author   Replies 
 JSP to Download File  Servlets / JSP  msi_333  7
 Struts2 upload file and ajax  Servlets / JSP  AskBot  2
 Link to download in my website..jsp or jsf to download file  Servlets / JSP  fcuritiba  2
 NS-2 and Trace file  CISCO systems  yosiffz  0
 How to create a file in java script using FireFox  Scripting Language  danyrouss  0

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  





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-2009
mileX v1.0 designed by codemiles team