File upload in Java, not JSP

T

tiewknvc9

Can anyone help point out what I should be researching in order to
upload a file from a client's machine (using a Java application
resident on their machine), to my web server?

thanks in advance
 
J

jagonzal

tiewknvc9 said:
Can anyone help point out what I should be researching in order to
upload a file from a client's machine (using a Java application
resident on their machine), to my web server?

thanks in advance

If you have a web page in your server that will listen for a file
upload, then you could use commons-httpclient to POST the file.

If you need a from-scratch solution on both sides, then have a look at
using sockets.
 
T

tiewknvc9

Thanks, these are the solutions I thought were my only options as
well... Too bad it's a dissapointment. Maybe FTp....

Oh well, I suppose that I will go the JSP route.

Thanks for the info!
 
O

Oliver Wong

tiewknvc9 said:
Thanks, these are the solutions I thought were my only options as
well... Too bad it's a dissapointment. Maybe FTp....

Maybe if you had said you thought of these solutions already and they
didn't satisfy you, and why they didn't satisfy you, someone would have
mentioned another solution.

- Oliver
 
L

Luke Webber

tiewknvc9 said:
Thanks, these are the solutions I thought were my only options as
well... Too bad it's a dissapointment. Maybe FTp....

Oh well, I suppose that I will go the JSP route.

Thanks for the info!

Why JSP? AFAIK, the only reason for using JSP is to provide an upload
link to click on. There are plenty of server-side file upload servlets
about (like the example in Jason Hunter's book), all you need is the
client-side logic, and that's not hard to do using HttpURLConnection.

I just did a quick Google and found this...

"naked chicks"

Hey! How'd that get there? I mean this..

http://www.jguru.com/faq/view.jsp?EID=62798

That's a bit limiting, because it assumes a text file, but that might be
OK for you. It would need some reworking for binary data. Probably need
to send it as a multipart attachment.

Cheers,
Luke
 
L

lethanhbinh87

Luke said:
Why JSP? AFAIK, the only reason for using JSP is to provide an upload
link to click on. There are plenty of server-side file upload servlets
about (like the example in Jason Hunter's book), all you need is the
client-side logic, and that's not hard to do using HttpURLConnection.

I just did a quick Google and found this...

"naked chicks"

Hey! How'd that get there? I mean this..

http://www.jguru.com/faq/view.jsp?EID=62798

That's a bit limiting, because it assumes a text file, but that might be
OK for you. It would need some reworking for binary data. Probably need
to send it as a multipart attachment.

Cheers,
Luke

If you use URLConnection, You cannot upload files with large amount
(Eg: larger than 100MB or whatsoever ). So, If you want to use Socket,
You had better search for some infor about HTTP Protocol with Uploading
function.
http://sourceforge.net/project/showfiles.php?group_id=59144
that OS project may oblige
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,265
Messages
2,571,071
Members
48,771
Latest member
ElysaD

Latest Threads

Top