@ Override public OutputStream receiveUpload ( String filename , String MIMEType ) { FileOutputStream fos ; // Output stream to write to try { file = File . createTempFile ( "upload" , filename . substring ( filename . lastIndexOf ( ' ' ) ) ) ; // Open the file for writing. fos = new FileOutputStream ( getFile ( ) ) ; } catch ( FileNotFoundException ex ) { // Error while opening the file. Not reported here. LOG . log ( Level . SEVERE , null , ex ) ; return null ; } catch ( IOException ex ) { // Error while opening the file. Not reported here. LOG . log ( Level . SEVERE , null , ex ) ; return null ; } return fos ; // Return the output stream to write to }
Callback method to begin receiving the upload .