try this :
try
{
String CONTENT_BOUNDARY = "-------------------------
URL url = new URL("http://www.testing.co
URLConnection uc = url.openConnection();
uc.setAllowUserInteraction
uc.setDoOutput(true);
uc.setDoInput(true);
uc.setRequestProperty("Con
File f = new File ( "C:/testing.txt" );
if ( myFileName == null )
{
myFileName = f.getName();
}
OutputStream os = uc.getOutputStream();
// Field 1 a Field of data
os.write((CONTENT_BOUNDARY
"Content-Disposition: form-data; name=\"callrepOID\"\r\n\r\
os.write((CONTENT_BOUNDARY
"Content-Disposition: form-data; name=\"FILE1\"; filename=\"" +
myFileName + "\"\r\nContent-Type: application/octet-stream\r
FileInputStream fis = new FileInputStream( f );
int data = -1;
while ( (data = fis.read() ) != -1 )
{
os.write( data );
}
os.write(("\r\n" + CONTENT_BOUNDARY + "--\r\n").getBytes());
os.flush();
os.close();
fis.close();
}
catch( Exception e )
{}
Main Topics
Browse All Topics





by: objectsPosted on 2002-11-21 at 16:58:04ID: 7481191
The following library does what you require: s/index.ht ml
http://www.servlets.com/co