@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
    }
@Override
    public OutputStream receiveUpload(String filename,
            String MIMEType) {
        FileOutputStream fos; 
        try {
            file = File.createTempFile("upload",
                    filename.substring(filename.lastIndexOf('.')));
            
            fos = new FileOutputStream(getFile());
        } catch (FileNotFoundException ex) {
            
            LOG.log(Level.SEVERE, null, ex);
            return null;
        } catch (IOException ex) {
            
            LOG.log(Level.SEVERE, null, ex);
            return null;
        }
        return fos; 
    }
@ 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.
Callback method to begin receiving the upload .