Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

File Transfer in ASCII mode.

807580Aug 24 2009 — edited Aug 25 2009
Using 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();
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 22 2009
Added on Aug 24 2009
9 comments
1,023 views