Anybody have some code snippets that uses https to put a file on a
webserver?  I can't seem to get anything to work.  I do have an example in
java that works.  But I'm no java coder.  I would like to convert to perl.

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++

java.net.URL sendUrl =new java.net.URL(
"http://10.2.0.232:28100/file?cmd=ft&name=testfile.mset&filter=mset"; );

java.net.HttpURLConnection conn =( java.net.HttpURLConnection
)sendUrl.openConnection();

//sendFile.setChunkedStreamingMode( -1 );

conn.setUseCaches( false );

conn.setRequestMethod( "PUT" );

conn.setDoOutput( true );

conn.connect();

 

java.io.OutputStreamWriter txtWriter = new java.io.OutputStreamWriter(
conn.getOutputStream() );

 

java.io.BufferedReader br = new java.io.BufferedReader(new
java.io.FileReader(new java.io.File("c:\\mark\\testFile2.txt")));

String temp=new String();

while((temp=br.readLine())!=null){

                txtWriter.write( temp );

                txtWriter.write( "\n" );

}

 

br.close();

txtWriter.close();

 

//int resp = conn.getResponseCode();

 

out.write( "response Code:"+conn.getResponseMessage() );

 

conn.disconnect();=

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++

 

TIA,

David M. Funk
President/CEO
 
Tivoli Certified Enterprise Consultant
Specializing in Network and Systems Management Solutions

 

Trinity Solutions           
604 Cassandra Dr.        
Cranberry Twp., PA 16066
 
Phone: 724-316-0721                    
Fax:     724-772-7889 
email:  <mailto:[EMAIL PROTECTED]> [EMAIL PROTECTED]
www:    <http://www.trinityITsolutions.com>
http://www.trinityITsolutions.com

 

<<attachment: winmail.dat>>

Reply via email to