public void setParameter ( final String name , final String filename , final InputStream is ) throws IOException { boundary ( ) ; writeName ( name ) ; write ( "; filename=\"" ) ; write ( filename ) ; write ( ' ' ) ; newline ( ) ; write ( "Content-Type: " ) ; String type = URLConnection . guessContentTypeFromName ( filename ) ; if ( type == null ) { type = "application/octet-stream" ; } writeln ( type ) ; newline ( ) ; pipe ( is , os ) ; newline ( ) ; }
Adds a file parameter to the request