File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes Uploading File with JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Uploading File with JSP" Watch "Uploading File with JSP" New topic
Author

Uploading File with JSP

Raymund Caga
Greenhorn

Joined: Apr 22, 2003
Posts: 3
Hi,
Im in a middle of a project. Im suppose to upload a file to a server using JSP. The problem is it should be automatic right after writing to the SIGNATURE PAD. another is that I should not use a INPUT TYPE=FILE bcoz it needs user interface...
Can anyone help me???
Thanks!!!

Raymund
Hugh Jamieson
Greenhorn

Joined: Dec 03, 2002
Posts: 8
Hi, Raymond!
Uploading files is a snap if you can use Struts. It offers some very nice handling of multipart forms, and has special beans that make the file available to your backend processing. I would check it out at jakarta.org.
Before I used Struts, I found some jsp + java code on the net. I will scrounge around to see if I still have it. Also, I think Marty Hall covered this topic in his book about Servlets + JSPs. I highly recommend this book + author.
I also remember some post about this topic on O'Reilly book website. I think they even have a helper javabean to do this.
Best of luck!!
Hugh
Jason Menard
Sheriff

Joined: Nov 09, 2000
Posts: 6450
I don't quite follow you on your requirements. What do you mean by "signature pad", and what is the problem with requiring a user interface?
Raymund Caga
Greenhorn

Joined: Apr 22, 2003
Posts: 3
Hi There,
Thanks for helping...
Most of the examples in the net and in the book use the INPUT TYPE=FILE which is possible but i cant use it bcoz (user reqmnts).
Signature Pad is a Device Im using right now. and the file that is being generated by the Pad is the one Im suppose to Upload to the Server...
I cant find any code that could upload without using the above mentioned...
Thank You... and Need help Badly....

Raymund
Jason Menard
Sheriff

Joined: Nov 09, 2000
Posts: 6450
So if I'm following you, and I'm still not sure that I am, you have an input device (a signature pad) which generates a file. Is this signature pad a piece of hardware? Is this file saved somewhere? Within the pad maybe?
From what I understand so far, it doesn't sound like JSP is the way to go, unless you have some specific reason you feel it should be JSP.
Raymund Caga
Greenhorn

Joined: Apr 22, 2003
Posts: 3
Hi Jason,
The signature pad is a hardware device. The file that is being generated is saved in a specific directory in the client computer.
The design goes like this, after generating the file in a specific directory. The program should get that file from the directory and upload it to the server. Actually the Sigbox.ocx is the one generating the file. I have no problem with generating the file. Now the problem is how to upload the file to the server. Most of the examples use Input Type=File, but it needs user interaction if I use it. Im looking for a code that can upload a file to a server with any user interaction...
Hope this will clear it...
Need your help...
Thank you...

Raymund
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Somehow you need to create a HTTP POST request and send it to the web server. You could check out the jakarta commons project's HttpClient subproject (especially the MultipartPostMethod class).


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Uploading File with JSP
 
Similar Threads
unable to get values for modify page
regarding updating web.xml with struts1.1
How to call the java code from Html Files Not Applets
How do i save a file that has been generated using JSP in excel format .
FrontMan Commands ?