File Transfer in ASCII mode.
807580Aug 24 2009 — edited Aug 25 2009Using Oracle Application Framework, I am trying to get a file from local machine and move to server(/tmp).
The following code works well and transfer the file in bimary format. But I would like to transfer in 'ASCII' format.
An abstract of code is produced below.
Appreciate if anyone can help me on this.
Thanks
DataObject fileUploadData =(DataObject)pageContext.getNamedDataObject("fileNameTF");
String fileName = null;
fileName = (String)fileUploadData.selectValue(null, "UPLOAD_FILE_NAME")
BlobDomain uploadedByteStream = null;
uploadedByteStream = (BlobDomain)fileUploadData.selectValue(null, fileName);
String contentType = null;
contentType =(String)fileUploadData.selectValue(null, "UPLOAD_FILE_MIME_TYPE")
File f=new File("/tmp");
fileoutputstream = new FileOutputStream(f);
InputStream inputstream =null;
inputstream = uploadedByteStream.getInputStream();
byte[] fileData = uploadedByteStream.toByteArray();
fileoutputstream.write(fileData);
fileoutputstream.close();
inputstream.close();