File upload using https-tomcat
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Asm_Asud
Posted On:   Tuesday, November 29, 2005 04:51 AM

Hi all, I am trying to upload/download files to a tomcat server using https protocol.The download files is working fine. I have implemented the following code try{ URL remoteFile=new URL(args[0]); URLConnection fileStream=remoteFile.openConnection(); // Open the input streams for the remote file fOut=new FileOutputStream(args[1]); // Open the output streams for saving this file on disk out=new DataOutputStream(fOut); in=new DataInputStream(fileStream.getInputStream()); // Read the remote on save save the file int data; while((data=in.read())!=-1){ fOut.write(data); } System.out.println("Download of " + ar   More>>

Hi all,
I am trying to upload/download files to a tomcat server using https protocol.The download files is working fine. I have implemented the following code

			
try{
URL remoteFile=new URL(args[0]);
URLConnection fileStream=remoteFile.openConnection();

// Open the input streams for the remote file
fOut=new FileOutputStream(args[1]);

// Open the output streams for saving this file on disk
out=new DataOutputStream(fOut);

in=new DataInputStream(fileStream.getInputStream());

// Read the remote on save save the file
int data;
while((data=in.read())!=-1){
fOut.write(data);
}
System.out.println("Download of " + args[0] + " is complete." );
}


This works fine.But can anyone pls tel me how can I upload a file to a server?

Please help
Thanks in advance    <<Less
About | Sitemap | Contact