Win a copy of Kotlin in Action this week in the Kotlin forum!
    Bookmark Topic Watch Topic
  • New Topic

How to read a file from client machine  RSS feed

 
Ruchika Kapoor
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hi,

Can anyone help to know how to read an excel file from client's machine.

Thanks,
Ruchika
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Report post to moderator
The user would need to upload the file to the server first. The Apache Commons FileUpload library can handle that on the server. Then your code can read the file by using a library such as Apache POI or jExcelApi.
 
Ruchika Kapoor
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hi,
My requirement is :

I've an html page with browse button on it. User will select the file from its local disk which needs to be uploaded to the ftp server. Now i am not able to read the file due to java security constraints. What are the ways to read the file from client machine.

Thanks,
Ruchika
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Report post to moderator
Since you posted to the JSP forum I'm assuming that your code runs as part of a web app; is that correct? If so, it can't access files on the client system. As I said above, they need to be uploaded to the server first.

I'm not clear how the FTP server fits in. An HTML page can't upload to an FTP server, only to a web server.
[ July 16, 2008: Message edited by: Ulf Dittmer ]
 
Ruchika Kapoor
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Report post to moderator
Thanks Ulf Dittmer!

Your suggestion worked.
 
chinmaya mishra
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Report post to moderator
Ruchika Kapoor wrote:Thanks Ulf Dittmer!

Your suggestion worked.


Hi ruchika,

Can you post your code here? i am also facing the same problem.

 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please do not resurrect old topics. This makes no sense. Asking for code makes also no sense. You're the developer here.

The answer to your problem is already given: use Apache Commons FileUpload.

Just start at their homepage http://commons.apache.org/fileupload and explore at least 'User Guide' and 'Frequently Asked Questions' links. It is certainly more than enough information how to develop a JSP page with file upload.
 
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!