Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
7) Create Column inside advTable for AttachedFile. Add sortable header and specify
PromptAttachedFile for it.
Add item to added Column. Assign
Id
eg. AttachedFile
Item Style
messageDownload
File MIME Type
Contenttype
//View Attribute which is picked from table
column
Data Type
BLOB
View Attribute as
AttachedFileName
// This will be name on Hyperlink.
Page 1 of 9
AttachedFile
File
Note :-- Upload Attachment button navigates to Upload Page. (For Inofrmation only)
Declarative Implementation
Perform the following steps to implement the File Download feature declaratively in an
OA Extension page.
Page 2 of 9
View Instance - The view object instance of the underlying data source.
View Attribute - The view attribute that maps to a column in the underlying data source.
File View Attribute - The view attribute that maps to the column that stores the file
content.
File Name Override - The file name to save to when you select the File Download link
and choose the
Save option in the File Download window to save the file. The default file name that appears
in the File
352
Name field of the Save As dialog window is derived from the value returned from the view
attribute
specified by the View Attribute property. The value of the File Name Override property
overrides that
default file name and is especially useful if the view attribute returns instructional text, such
as "Click on
this link to download the file". If the File Name Override property is not defined, then the file
name to
save to is the value returned from the view attribute.
File MIME Type - The MIME type of the file. See the Runtime Control example below if
you do not want
to specify a static value for this property.
Data Type - The data type of the File View Attribute. The BLOB datatype is supported
for File
Download.
Prompt - The text prompt that proceeds the File Download link.
r
Page 3 of 9
Page 4 of 9
} // end apply()
**********************************************************
}
catch (IOException e)
{
e.printStackTrace();
}
catch (SQLException e)
{
e.fillInStackTrace();
}
// return the filled BlobDomain
return blobDomain;
}
**********************************************************
if(fileUploadData != null)
{
String uFileName =
fileId.toString()+"_"+(String)
fileUploadData.selectValue(null,"UPLOAD_FILE_NAME");
String contentType =
(String)fileUploadData.selectValue(null,"UPLOAD_FILE_MIME_TYPE");
row.setAttribute("AttachedFile", createBlobDomain(fileUploadData));
row.setAttribute("AttachedFileName", uFileName);
row.setAttribute("Contenttype", contentType);
}
// File Upload Ends
Page 7 of 9
am.invokeMethod("apply");
String fileName = (String)vo.getCurrentRow().getAttribute("AttachedFileName");
OAException confirmMessage = new OAException("File "+fileName+" uploaded
succesfully .",OAException.CONFIRMATION);
pageContext.putDialogMessage(confirmMessage);
}
**********************************************************
Note:
You can set the profile option called UPLOAD_FILE_SIZE_LIMIT to specify the maximum size
of the file
a user can upload. For example, if you set UPLOAD_FILE_SIZE_LIMIT to 500K, then
during the http POST
request, OA Framework reads only up to 500K from the stream and throws an exception if
the uploaded file is
larger than 500K.
Page 8 of 9
For
OAF Page to Upload Files into Server from local Machine
https://blogs.oracle.com/prajkumar/entry/oaf_page_to_upload_files
http://mukx.blogspot.com/2010/01/upload-file-to-application-server-using.html
http://mystuffoaf.blogspot.com/2012/03/uploading-file-into-server-from-local.html?
zx=61db5b806994d831
Page 9 of 9