how to transfer a big file from an application program to web server

hi, all

a problem confused me and so urgent.

and now I have a servlet to process the file uploaded from browser and it can work successfully. and I want to upload many files from java application program using this servlet. I used URLConnection, but how to do, who can give me some example?

thanks a lot

regarding

mhuang@netease.com

[377 byte] By [leech huang] at [2007-9-26 1:17:41]
# 1
try this, http://developer.java.sun.com/developer/qow/archive/140/index.jsp
mchan0 at 2007-6-29 0:47:34 > top of Java-index,Archived Forums,Java Programming...
# 2

hi,

I know how to post some parameter to servlet and get the response and download a file

but i don't know how to upload a file using URLConnection. and I get a good java package named JSPSmartUpload.jar to arrange the file uploaded from browser and save them to the specified path in web server. so I can upload a file through browser, now how to upload a file through a java program rather than browser.

please give me more advice.

thanks

mhuang@sina.com.cn

leech huang at 2007-6-29 0:47:34 > top of Java-index,Archived Forums,Java Programming...
# 3
the technique is general, you can send any object. you can read strings or bytes send and receive before sending more until complete. if it is a really large file, sockets are pretty fast.
mchan0 at 2007-6-29 0:47:34 > top of Java-index,Archived Forums,Java Programming...