Upload to BLOB

How can you do an upload into a blob using ADF/JSP/Struts? I've seen the demo for OrdDoc but would rather have the blob as it would be easier to move between instances over a db link (cannot do with object type).
Thoughts/tips/code?
I can provide what does NOT work...

Here is the code I am using (Error message first):
Target URL -- http://10.141.146.47:8988/UploadedFiles-ViewController-context-root/uploadDocument.do
06/12/19 07:49:45 Oracle Application Server Containers for J2EE 10g (10.1.2.0.2) initialized
Dec 19, 2006 7:49:45 AM org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='org.apache.struts.util.LocalStrings', returnNull=true
Dec 19, 2006 7:49:45 AM org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='org.apache.struts.action.ActionResources', returnNull=true
Dec 19, 2006 7:49:45 AM org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='uploadedfiles.view.ApplicationResources', returnNull=true
06/12/19 07:49:48 *** UploadDocumentAction.findForward() ***
Dec 19, 2006 7:49:48 AM org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='org.apache.struts.taglib.html.LocalStrings', returnNull=true
Dec 19, 2006 7:49:48 AM org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='org.apache.struts.taglib.html.LocalStrings', returnNull=true
Dec 19, 2006 7:49:48 AM org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='org.apache.struts.util.LocalStrings', returnNull=true
Dec 19, 2006 7:49:48 AM org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='org.apache.struts.taglib.html.LocalStrings', returnNull=true
Dec 19, 2006 7:49:48 AM org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='org.apache.struts.taglib.html.LocalStrings', returnNull=true
06/12/19 07:49:55 *** UploadDummyBlobAction.onUpload - START ***
06/12/19 07:49:55 myrow.getId() = null
06/12/19 07:49:56 myrow.getFilename() = null
06/12/19 07:49:56 java.lang.NullPointerException
06/12/19 07:49:56 at uploadedfiles.view.UploadDocumentAction.onUpload(UploadDocumentAction.java:82)
06/12/19 07:49:56 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
06/12/19 07:49:56 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
06/12/19 07:49:56 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
06/12/19 07:49:56 at java.lang.reflect.Method.invoke(Method.java:324)
06/12/19 07:49:56 at oracle.adf.controller.lifecycle.PageLifecycle.handleEvent(PageLifecycle.java:544)
06/12/19 07:49:56 at oracle.adf.controller.struts.actions.StrutsPageLifecycle.handleEvent(StrutsPageLifecycle.java:252)
06/12/19 07:49:56 at oracle.adf.controller.lifecycle.PageLifecycle.processComponentEvents(PageLifecycle.java:477)
06/12/19 07:49:56 at oracle.adf.controller.struts.actions.DataAction.processComponentEvents(DataAction.java:235)
06/12/19 07:49:56 at oracle.adf.controller.struts.actions.DataAction.processComponentEvents(DataAction.java:430)
06/12/19 07:49:56 at oracle.adf.controller.lifecycle.PageLifecycle.handleLifecycle(PageLifecycle.java:126)
06/12/19 07:49:56 at oracle.adf.controller.struts.actions.DataAction.handleLifecycle(DataAction.java:222)
06/12/19 07:49:56 at oracle.adf.controller.struts.actions.DataAction.execute(DataAction.java:153)
06/12/19 07:49:56 at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
06/12/19 07:49:56 at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
06/12/19 07:49:56 at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
06/12/19 07:49:56 at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
06/12/19 07:49:56 at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
06/12/19 07:49:56 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
06/12/19 07:49:56 at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
06/12/19 07:49:56 at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source)
06/12/19 07:49:56 at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
06/12/19 07:49:56 at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:239)
06/12/19 07:49:56 at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:659)
06/12/19 07:49:56 at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330)
06/12/19 07:49:56 at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830)
06/12/19 07:49:56 *** UploadDocumentAction.findForward() ***
06/12/19 07:49:56 UploadDocumentAction.findForward()- event : Upload
06/12/19 07:49:56 at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:285)
06/12/19 07:49:56 at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:126)
06/12/19 07:49:56 at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
06/12/19 07:49:56 at java.lang.Thread.run(Thread.java:534)
public class UploadDocumentAction extends DataForwardAction {
protected void processUpdateModel(DataActionContext actionContext) {
super.processUpdateModel(actionContext);
// Create a blank record in the model and set it as the current row
BindingContext bc = actionContext.getBindingContext();
DCDataControl dc = bc.findDataControl("UploadedFilesServiceDataControl");
UploadedFilesService service = (UploadedFilesService)dc.getDataProvider();
service.insertRowIntoUploadedFilesView();
* public void onUpload( DataActionContext ctx )
* This handles uploading a file into a blob domain by use of a
* transient view attribute (TempOrdDoc) and then getting the uploaded
* file (which is passivated to the oc4j's ordpas folder) and then placing
* this via input/output stream calls into a BlobDomain to place into the
* view object's row.
* Processing Steps:
* 1. Get access to the current row of the iterator and cast it to an
* exposed client interface. This allows easier placement of the
* values into the record.
* 2. Get access to the TempOrdDoc and retrieve the file source content.
* this appears to contain the ORD IM passivated blob,ie:
* C:\jdev1012\jdev\system10.1.2.0.0.1811\oc4j-config\ordpas\ord10858pas
* 3. Create input stream to this object and output stream to the view
* object's blob, then read/write the data.
* 4. Set the view object columns: Content Type, Size, and Blob. Note that
* we have to get the description from the request to set it.
* 5. Get access to the application module, then commit the transaction.
* @param ctx
public void onUpload( DataActionContext ctx ) {
System.out.println("*** UploadDocumentAction.onUpload - START ***");
HttpServletRequest request = ctx.getHttpServletRequest();
try {
DCBindingContainer bc = ctx.getBindingContainer();
DCIteratorBinding iter = bc.findIteratorBinding("UploadedFilesView1Iterator");
Row r = iter.getCurrentRow();
UploadedFilesViewRowClient myrow = (UploadedFilesViewRowClient) r;
System.out.println("myrow.getId() = " + myrow.getId());
System.out.println("myrow.getFilename() = " + myrow.getFilename());
OrdDocDomain doc = myrow.getTempOrdDocDomain();
OrdContentSource ocontent = doc.getContentSource();
OrdFileSource fSource = (OrdFileSource) ocontent;
System.out.println( "fSource.getContentLength()=" + fSource.getContentLength());
System.out.println( "fSource.getFileName()=" + fSource.getFileName() );
System.out.println( "fSource.getMimeType()=" + fSource.getMimeType() );
InputStream istream = fSource.getInputStream();
BlobDomain blob = myrow.getContent();
int bufsize;
if ( blob == null ) {
blob = new BlobDomain();
bufsize = 32767;
} else {
bufsize = blob.getBufferSize();
r.lock(); // required for a blob update.
OutputStream out = blob.getBinaryOutputStream();
int length = 0;
byte buf[] = new byte[bufsize];
while ((istream != null) && ((length = istream.read(buf)) != -1)) {
out.write(buf, 0, length);
System.out.println("read " + length + " bytes from in, writing to out");
istream.close();
out.flush();
out.close();
myrow.setContent( blob );
BindingContext bctx = ctx.getBindingContext();
DCDataControl dc = bctx.findDataControl("UploadedFilesServiceDataControl");
UploadedFilesService service = (UploadedFilesService)dc.getDataProvider();
service.saveRowUploadedFilesView();
catch ( Exception ex )
// required by fSource.getInputStream();
ex.printStackTrace();
} // onUpload
protected void findForward(DataActionContext actionContext) throws Exception {
System.out.println("*** UploadDocumentAction.findForward() ***");
// Try to catch errors instead of the default error handler.
try {
List events = actionContext.getEvents();
if (events != null && events.size() > 0) {
ListIterator li = events.listIterator();
while (li.hasNext()) {
System.out.println("UploadDocumentAction.findForward()- event : " + li.next().toString());
} catch (Exception e) {
System.out.println(e.getMessage() );
e.printStackTrace(System.out);
super.findForward(actionContext);
/* UploadedFilesViewRowClient.java */
public class UploadedFilesViewRowClient extends RowImpl
* This is the default constructor (do not remove)
public UploadedFilesViewRowClient() {}
public oracle.jbo.domain.Number getId() {
return (oracle.jbo.domain.Number)getAttribute("Id");
public void setId(oracle.jbo.domain.Number value) {
setAttribute("Id", value);
public String getFilename() {
return (String)getAttribute("Filename");
public void setFilename(String value) {
setAttribute("Filename", value);
public oracle.jbo.domain.BlobDomain getContent() {
return (oracle.jbo.domain.BlobDomain)getAttribute("Content");
public void setContent(oracle.jbo.domain.BlobDomain value) {
setAttribute("Content", value);
public oracle.jbo.domain.Date getDateCreated() {
return (oracle.jbo.domain.Date)getAttribute("DateCreated");
public void setDateCreated(oracle.jbo.domain.Date value) {
setAttribute("DateCreated", value);
public oracle.ord.im.OrdDocDomain getTempOrdDocDomain() {
return (oracle.ord.im.OrdDocDomain)getAttribute("TempOrdDocDomain");
public void setTempOrdDocDomain(oracle.ord.im.OrdDocDomain value) {
setAttribute("TempOrdDocDomain", value);
/* UploadedFilesServiceImpl.java */
public void insertRowIntoUploadedFilesView() {
//vo is your view object
ViewObject vo = getUploadedFilesView1();
Row aRow = vo.createRow();
aRow.setNewRowState(Row.STATUS_INITIALIZED);
/* Do these get populated automatically? Yes! since setup in entity as historical */
vo.insertRow(aRow);
vo.setCurrentRow(aRow);
// getTransaction().commit();
public void saveRowUploadedFilesView() {
//vo is your view object
ViewObject vo = getUploadedFilesView1();
getTransaction().commit();
...

Similar Messages

  • Uploading Page Blob to Azure - Storage Exception: Make sure the value of Authorization header is formed correctly

    I am using Microsoft Azure Java SDK for Uploading Page Blobs (Size: 20G/40G). IN mid of Uploading, SDK throws Storage Exception:
    java.io.IOException: null
    at com.microsoft.azure.storage.core.Utility.initIOException(Utility.java:584) ~[classes/:na]
    at com.microsoft.azure.storage.blob.BlobOutputStream$2.call(BlobOutputStream.java:414) ~[classes/:na]
    at com.microsoft.azure.storage.blob.BlobOutputStream$2.call(BlobOutputStream.java:398) ~[classes/:na]
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) ~[na:1.7.0_25]
    at java.util.concurrent.FutureTask.run(FutureTask.java:166) ~[na:1.7.0_25]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) ~[na:1.7.0_25]
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) ~[na:1.7.0_25]
    at java.util.concurrent.FutureTask.run(FutureTask.java:166) ~[na:1.7.0_25]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) ~[na:1.7.0_25]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) ~[na:1.7.0_25]
    at java.lang.Thread.run(Thread.java:724) ~[na:1.7.0_25]
    Caused by: com.microsoft.azure.storage.StorageException: Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
    at com.microsoft.azure.storage.StorageException.translateException(StorageException.java:162) ~[azure-storage-1.2.0.jar:na]
    at com.microsoft.azure.storage.core.StorageRequest.materializeException(StorageRequest.java:306) ~[azure-storage-1.2.0.jar:na]
    at com.microsoft.azure.storage.core.ExecutionEngine.executeWithRetry(ExecutionEngine.java:178) ~[classes/:na]
    at com.microsoft.azure.storage.blob.CloudPageBlob.putPagesInternal(CloudPageBlob.java:642) ~[classes/:na]
    at com.microsoft.azure.storage.blob.CloudPageBlob.uploadPages(CloudPageBlob.java:971) ~[classes/:na]
    at com.microsoft.azure.storage.blob.BlobOutputStream$2.call(BlobOutputStream.java:402) ~[classes/:na]
    ... 9 common frames omitted
    SDK Version:
    <groupId>com.microsoft.azure</groupId>
    <artifactId>azure-storage</artifactId>
    <version>1.2.0</version>
    Please note this error shows up in the mid of Upload randomly: For example: Transferred bytes: 27325890560 out of total 42949673472 successfully and then fails with Exception pasted above.
    Is there a chance of time drift on a Linux Box causing this issue ? Any other pointers would help.
    Thanks.

    Hi Kriti,
    We believe its a timing issue. Would you be able to refer the following link and check if it helps?
    http://blogs.msdn.com/b/kwill/archive/2013/08/28/http-403-server-failed-to-authenticate-the-request-when-using-shared-access-signatures.aspx
    If not, would you be able to share the fiddler trace for this?
    Regards,
    Malar.

  • [Solved]How to upload / download BLOB images ADF - JSF

    Hi everyone. I am a newbe ADF - JSF developer and I need to do a web app. in which I have to upload jpeg images to a table (in an oracle 8 DB) that has a BLOB column, also I need to be able to download images from the same table and show them in the web app. I have seen the examples on how to do this using the intermedia data types but I can't use this because the table already has a lot of records in it and the DB admin won't move a finger to migrate the data because other apps. are using the table.
    I have been looking on the internet but haven't been able to find something that describes this process.
    Thanks.

    Hello Kuba, I am trying to execute your app but I get the following error when I try to run it:
    oracle.classloader.util.AnnotatedNoClassDefFoundError:
         Missing class: oracle.adf.view.faces.webapp.AdfFacesFilterHelper
         Dependent class: oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl
         Loader: current-workspace-app.web.ADFUploadAndDownloadFiles-ViewController-webapp:0.0.0
         Code-Source: /root/jdevhome/mywork/ADFUploadAndDownloadFiles/ViewController/public_html/WEB-INF/lib/adf-faces-impl.jar
         Configuration: WEB-INF/lib/ directory in /root/jdevhome/mywork/ADFUploadAndDownloadFiles/ViewController/public_html/WEB-INF/lib
    The missing class is not available from any code-source or loader in the system.
         at oracle.classloader.PolicyClassLoader.handleClassNotFound (PolicyClassLoader.java:2051) [usr/local/jdevstudio1013/j2ee/home/lib/pcl.jar (from system property java.class.path), by sun.misc.Launcher$AppClassLoader@27634497]
         at oracle.classloader.PolicyClassLoader.internalLoadClass (PolicyClassLoader.java:1665) [usr/local/jdevstudio1013/j2ee/home/lib/pcl.jar (from system property java.class.path), by sun.misc.Launcher$AppClassLoader@27634497]
         at oracle.classloader.PolicyClassLoader.loadClass (PolicyClassLoader.java:1621) [usr/local/jdevstudio1013/j2ee/home/lib/pcl.jar (from system property java.class.path), by sun.misc.Launcher$AppClassLoader@27634497]
         at oracle.classloader.PolicyClassLoader.loadClass (PolicyClassLoader.java:1606) [usr/local/jdevstudio1013/j2ee/home/lib/pcl.jar (from system property java.class.path), by sun.misc.Launcher$AppClassLoader@27634497]
         at java.lang.ClassLoader.loadClassInternal (ClassLoader.java:319) [jre bootstrap, by jre.bootstrap]
         at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl.<init> (AdfFacesFilterImpl.java:341) [root/jdevhome/mywork/ADFUploadAndDownloadFiles/ViewController/public_html/WEB-INF/lib/adf-faces-impl.jar (from WEB-INF/lib/ directory in /root/jdevhome/mywork/ADFUploadAndDownloadFiles/ViewController/public_html/WEB-INF/lib), by current-workspace-app.web.ADFUploadAndDownloadFiles-ViewController-webapp:0.0.0]
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0 (Native method) [unknown, by unknown]
         at sun.reflect.NativeConstructorAccessorImpl.newInstance (NativeConstructorAccessorImpl.java:39) [unknown, by unknown]
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance (DelegatingConstructorAccessorImpl.java:27) [unknown, by unknown]
         at java.lang.reflect.Constructor.newInstance (Constructor.java:494) [unknown, by unknown]
         at java.lang.Class.newInstance0 (Class.java:350) [jre bootstrap, by jre.bootstrap]
         at java.lang.Class.newInstance (Class.java:303) [jre bootstrap, by jre.bootstrap]
         at oracle.adf.view.faces.webapp.AdfFacesFilter.init (AdfFacesFilter.java:48) [jre bootstrap, by jre.bootstrap]
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpApplication.getFilterConfig (HttpApplication.java:7523) [jre bootstrap, by jre.bootstrap]
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.invoke (ServletRequestDispatcher.java:548) [jre bootstrap, by jre.bootstrap]
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.forwardInternal (ServletRequestDispatcher.java:376) [usr/local/jdevstudio1013/jlib/adf-faces-api.jar (from <classpath> in /root/jdevhome/mywork/ADFUploadAndDownloadFiles/ViewController/public_html), by current-workspace-app.web.ADFUploadAndDownloadFiles-ViewController-webapp:0.0.0]
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.doProcessRequest (HttpRequestHandler.java:870) [usr/local/jdevstudio1013/j2ee/home/lib/oc4j-internal.jar (from <code-source> in META-INF/boot.xml in /usr/local/jdevstudio1013/j2ee/home/oc4j.jar), by oc4j:10.1.3]
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.processRequest (HttpRequestHandler.java:451) [usr/local/jdevstudio1013/j2ee/home/lib/oc4j-internal.jar (from <code-source> in META-INF/boot.xml in /usr/local/jdevstudio1013/j2ee/home/oc4j.jar), by oc4j:10.1.3]
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.serveOneRequest (HttpRequestHandler.java:218) [usr/local/jdevstudio1013/j2ee/home/lib/oc4j-internal.jar (from <code-source> in META-INF/boot.xml in /usr/local/jdevstudio1013/j2ee/home/oc4j.jar), by oc4j:10.1.3]
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.run (HttpRequestHandler.java:119) [usr/local/jdevstudio1013/j2ee/home/lib/oc4j-internal.jar (from <code-source> in META-INF/boot.xml in /usr/local/jdevstudio1013/j2ee/home/oc4j.jar), by oc4j:10.1.3]
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.run (HttpRequestHandler.java:112) [usr/local/jdevstudio1013/j2ee/home/lib/oc4j-internal.jar (from <code-source> in META-INF/boot.xml in /usr/local/jdevstudio1013/j2ee/home/oc4j.jar), by oc4j:10.1.3]
         at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run (ServerSocketReadHandler.java:260) [usr/local/jdevstudio1013/j2ee/home/lib/oc4j-internal.jar (from <code-source> in META-INF/boot.xml in /usr/local/jdevstudio1013/j2ee/home/oc4j.jar), by oc4j:10.1.3]
         at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket (ServerSocketAcceptHandler.java:230) [usr/local/jdevstudio1013/j2ee/home/lib/oc4j-internal.jar (from <code-source> in META-INF/boot.xml in /usr/local/jdevstudio1013/j2ee/home/oc4j.jar), by oc4j:10.1.3]
         at oracle.oc4j.network.ServerSocketAcceptHandler.access$800 (ServerSocketAcceptHandler.java:33) [usr/local/jdevstudio1013/j2ee/home/lib/oc4j-internal.jar (from <code-source> in META-INF/boot.xml in /usr/local/jdevstudio1013/j2ee/home/oc4j.jar), by oc4j:10.1.3]
         at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run (ServerSocketAcceptHandler.java:831) [usr/local/jdevstudio1013/j2ee/home/lib/oc4j-internal.jar (from <code-source> in META-INF/boot.xml in /usr/local/jdevstudio1013/j2ee/home/oc4j.jar), by oc4j:10.1.3]
         at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].util.ReleasableResourcePooledExecutor$MyWorker.run (ReleasableResourcePooledExecutor.java:298) [usr/local/jdevstudio1013/j2ee/home/lib/oc4j-internal.jar (from <code-source> in META-INF/boot.xml in /usr/local/jdevstudio1013/j2ee/home/oc4j.jar), by oc4j:10.1.3]
         at java.lang.Thread.run (Thread.java:595) [usr/local/jdevstudio1013/j2ee/home/lib/oc4j-internal.jar (from <code-source> in META-INF/boot.xml in /usr/local/jdevstudio1013/j2ee/home/oc4j.jar), by oc4j:10.1.3]
    I'm sure this is trivial for for you, but I can't figure it what to do.... can you help a little here please?
    Thanks.

  • How to display .doc/.xls file uploaded using blob type of column in table.

    Hi,
    Here
    http://www.oracle.com/technology/obe/apex/apex31nf/apex31blob.htm
    I learnt about uploading & viewing file through BLOB in a form or report . It works fine for pictures & notepad file. But when i upload word file (i.e. *.doc) or excel file ( *.xls ) , and try to view it through DOWNLOAD
    it gives message box
    ' Do you want to save this file, or find program online to open it?'
    I searched lot but enable to find proper & easy to understand solution.
    Hope understand my problem.
    Thanks in advance.

    Hi,
    I am using table emp having fields id,name,,,,,,,,,photo,mimetype,filename,last_update_date.
    photo is of type BLOB. I updated photo (text item) on form.
    I Used BLOB DOWNLOAD Format Mask with appropriate entries & selected display as Attachment.
    So my problem is partially solved. Now if DOWNLOAD link on Form is clicked it displays Excel sheet
    in different window. But still, DOWNLOAD link on my Interactive report not working properly.
    DOWLOAD on interactive if it is clicked it has two problems
    1) It opens image or notepad file in same window.
    2) Not able to open Excel sheet.
    thanks for reply.

  • How to upload a BLOB file from CMP Entity Beans

    Hi,
    I want to upload a .xls file as a BLOB using CMP. And also to get back the BLOB from the database through CMP. I am using oracle 8i DataBase and weblogic 8.1 server with weblogic workshop as IDE.
    I don't have any idea to save a file as BLOB.
    Could any one please help me to solve this as it is very urgent.
    regards
    KumudaRajarshi

    I would just put the .xls file into a byte array in a
    class that implements the serializable
    interface. This class then becomes a column in your
    database table(as a blob) represented by an
    attribute in your entity bean. On sun appserver7
    serializable is mapped to a blob column in the
    database by default. You don't have to deal with a
    blob at all in the code, just your
    serializable type. You may have to use a type 2
    driver to get it to work with files
    over 4 or 5k.
    See the appserver7 EJBdevguide, page 92 for details.could you descrbe the detail how to use the class to become the column as blob?
    is that any sample code can be provided?
    it's very urgent, please help..
    thanks

  • A final solution for upload/download BLOB on JSP?

    Hello there, greetings to forum,
    I am working on JSPs and Oracle 9i with Tomcat 4.1.29. Suppose we have the very simple example of a user who registers through an HTML form by entering his name, surname and his picture via the "Browse" field (input type="file" etc). Everything so far so good for now until the next page waits for the parameters.
    My main problem is how to tell my server (tomcat) that the remote user browsed his file from e.g. c:\docs\pics\vacation\ ??? As far as i can remember the JSP code is server sided so i can't tell tomcat that the file is in c:\docs\pics\vation\ . And finally: how do i grab the picture for the user's dir? The rest i know, how to put it in the BLOB column and so on. And also, is there any way of checking if the user uploads a photo or anything else except than examining the extension?
    Thanx in advance, be well all.

    Can you do me the favor of sending the new SYMCJIT.DLL file, I
    need it badly, I have a test coming up and I still havent been
    able to install Oracle Personal on my computer. Also do you know
    if I need to install the Form Builder first and then Personal
    Oracle? But before I forget I dont have a P4, so if this file
    doesnt associate to the issue that I cant install on Win XP,
    then you can disregard this note.
    Thank You,
    New user & loving it.
    Dear all,
    I have a new SYMCJIT.DLL file that can solve this problem. This
    is only a 26.4 K file. If any body require this please send me a
    mail.
    I there anybody who could install D2K 6i rel 2 on P4 with
    windows XP?
    Take care,
    [email protected]

  • Finally upload/download BLOB solution in JSP??

    Hello there, greetings to forum,
    I am working on JSPs and Oracle 9i with Tomcat 4.1.29. Suppose we have the very simple example of a user who registers through an HTML form by entering his name, surname and his picture via the "Browse" field (input type="file" etc). Everything so far so good for now until the next page waits for the parameters.
    My main problem is how to tell my server (tomcat) that the remote user browsed his file from e.g. c:\docs\pics\vacation\ ??? As far as i can remember the JSP code is server sided so i can't tell tomcat that the file is in c:\docs\pics\vation\ . And finally: how do i grab the picture for the user's dir? The rest i know, how to put it in the BLOB column and so on. And also, is there any way of checking if the user uploads a photo or anything else except than examining the extension?
    Thanx in advance, be well.
    PS. Don't post servlet-like code, i am 100% on JSPs unless you suggest a Java Stored Procedure.

    Hello there, greetings to forum,
    I am working on JSPs and Oracle 9i with Tomcat 4.1.29. Suppose we have the very simple example of a user who registers through an HTML form by entering his name, surname and his picture via the "Browse" field (input type="file" etc). Everything so far so good for now until the next page waits for the parameters.
    My main problem is how to tell my server (tomcat) that the remote user browsed his file from e.g. c:\docs\pics\vacation\ ??? As far as i can remember the JSP code is server sided so i can't tell tomcat that the file is in c:\docs\pics\vation\ . And finally: how do i grab the picture for the user's dir? The rest i know, how to put it in the BLOB column and so on. And also, is there any way of checking if the user uploads a photo or anything else except than examining the extension?
    Thanx in advance, be well.
    PS. Don't post servlet-like code, i am 100% on JSPs unless you suggest a Java Stored Procedure.

  • Name of uploaded file (BLOB) in Servlet

    Hi,
    I'm trying to save into DB any file I want throw servlet via POST request.
    Is there any way how to get the name of uploaded file from posted information (from posted file).
    Then I save this file as BLOB into DB.
    Can you help me with getting the file name???
    Because I would like to save the name also into DB...
    Thanks Jan

    Jason Hunter of Servlet fame and fortune has had a general servlet framework extension available for quite a while now. This has code which supports many common operations, including handling multipart-file upload.
    See http://www.servlets.com/cos/index.html#classes and more specifically http://www.servlets.com/cos/javadoc/com/oreilly/servlet/MultipartRequest.html
    The code is available, so you should be able to take a peek and see how he handles this issue, as an example.
    cheers
    -steve-

  • Hex string upload as blob data to sql server

    It need to open a file and read the content and upload to sql server(2005) as blob data.
    But it seems give error as the attached screen.
    So I tried to convert the file content string to hex string, but it take quite long time.
    Is there any way to shorten the time or any other ways.
    Any suggestion, thanks.
    Attachments:
    ss.png ‏73 KB

    Try this.

  • XML upload (with BLOBs) failed

    I want to import XML data (with BLOBS) from a APEX-2.0 XML data download.
    The upload works fine on another Server having APEX2.0 installed.
    Installing on XE results in: XML load error.
    Using an XML data export without BLOB works fine.
    Any ideas?

    sorry, first reply write error
    had already looked for language-problems, but there are not:
    export from htmldb.oracle.com(APEX2.0)->
    NLS_DATABASE_Parameters: AMERICAN_AMERICA.AL32UTF8
    atabase is
    import in XE(APEX2.1)->
    NLS_DATABASE_Parameters: AMERICAN_AMERICA.AL32UTF8
    NLS_LANG: AMERICAN_AMERICA.AL32UTF8
    "XML load error" occurs only with the BLOB inside, if I export the table data without the blob column, it works.
    Importing in an APEX2.0 EE-environment (even if is WE8MSWIN1252 database, not UTF8 database)

  • Conserving filename with upload via portal form into blob type

    Hi
    I have a little question. Is there any chance to conserve a filename, which was uploaded into blob column via portal form and then create link for this file with the same name?
    null

    Vlasta,
    You certanly can save the original filename in your form, to do that you will need to add a FILENAME varchar2 column to your table and write a simple Javascript (search this forum for examples) to copy the fileselect value with onChange event. So, when you submit the form with your file the original name will be stored in you table.
    Thanks,
    Dmitry

  • How to upload/download to blob using ADF-toplink?

    I am using ADF-toplink,i tried upload to blob using some of the code given in the ADFBC upload/download application...IT WORKED... but download is not working...I want to know some better method for both uploading and downloading... IN ADF-TOPLINK only......

    Hi guys,
    I'm able to download file in ADF using af:fileDownloadActionListener.......
    does any one knows how to upload a file using ADF???

  • Problem on uploading blob file to database using KUBA's example

    I tried running KUBAS's example found on this thread [Solved]How to upload / download BLOB images ADF - JSF
    but a lot of exceptions occured...
    I'm using jdev 10.1.3.2.0(i put my jdev's libraries) and oracle database 10g as i wrote in the other thread.
    any help would be more than appreciated
    07/05/05 13:48:14 javax.faces.el.EvaluationException: oracle.jbo.common.ampool.ApplicationPoolException: JBO-30003: The application pool (zilp.testcase.model.service.BlobAMLocal) failed to checkout an application module due to the following exception:
    07/05/05 13:48:14      at com.sun.faces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:190)
    07/05/05 13:48:14      at com.sun.faces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:143)
    07/05/05 13:48:14      at zilp.testcase.view.util.JSFUtils.resolveExpression(JSFUtils.java:163)
    07/05/05 13:48:14 oracle.jbo.common.ampool.ApplicationPoolException: JBO-30003: The application pool (zilp.testcase.model.service.BlobAMLocal) failed to checkout an application module due to the following exception:
    07/05/05 13:48:14      at zilp.testcase.view.util.ADFUtils.getApplicationModule(ADFUtils.java:26)
    07/05/05 13:48:14      at zilp.testcase.view.backing.Uploading.uploadAction(Uploading.java:58)
    07/05/05 13:48:14      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    07/05/05 13:48:14      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    07/05/05 13:48:14      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    07/05/05 13:48:14      at java.lang.reflect.Method.invoke(Method.java:585)
    07/05/05 13:48:14      at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:146)
    07/05/05 13:48:14      at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:92)
    07/05/05 13:48:14      at oracle.adf.view.faces.component.UIXCommand.broadcast(UIXCommand.java:211)
    07/05/05 13:48:14      at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:287)
    07/05/05 13:48:14      at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:401)
    07/05/05 13:48:14      at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:95)
    07/05/05 13:48:14      at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:245)
    07/05/05 13:48:14      at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:110)
    07/05/05 13:48:14      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:213)
    07/05/05 13:48:14      at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
    07/05/05 13:48:14      at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._invokeDoFilter(AdfFacesFilterImpl.java:228)
    07/05/05 13:48:14      at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._doFilterImpl(AdfFacesFilterImpl.java:197)
    07/05/05 13:48:14      at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl.doFilter(AdfFacesFilterImpl.java:171)
    07/05/05 13:48:14      at oracle.adf.view.faces.webapp.AdfFacesFilter.doFilter(AdfFacesFilter.java:103)
    07/05/05 13:48:14      at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)
    07/05/05 13:48:14      at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:162)
    07/05/05 13:48:14      at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:620)
    07/05/05 13:48:14      at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:369)
    07/05/05 13:48:14      at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:865)
    07/05/05 13:48:14      at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:447)
    07/05/05 13:48:14      at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:215)
    07/05/05 13:48:14      at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:117)
    07/05/05 13:48:14      at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:110)
    07/05/05 13:48:14      at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
    07/05/05 13:48:14      at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239)
    07/05/05 13:48:14      at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34)
    07/05/05 13:48:14      at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880)
    07/05/05 13:48:14      at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
    07/05/05 13:48:14      at java.lang.Thread.run(Thread.java:595)
    07/05/05 13:48:14 Caused by: oracle.jbo.common.ampool.ApplicationPoolException: JBO-30003: The application pool (zilp.testcase.model.service.BlobAMLocal) failed to checkout an application module due to the following exception:
    07/05/05 13:48:14      at oracle.jbo.common.ampool.ApplicationPoolImpl.doCheckout(ApplicationPoolImpl.java:2002)
    07/05/05 13:48:14      at oracle.jbo.common.ampool.ApplicationPoolImpl.useApplicationModule(ApplicationPoolImpl.java:2793)
    07/05/05 13:48:14      at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:453)
    07/05/05 13:48:14      at oracle.jbo.http.HttpSessionCookieImpl.useApplicationModule(HttpSessionCookieImpl.java:233)
    07/05/05 13:48:14      at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:424)
    07/05/05 13:48:14      at oracle.jbo.common.ampool.SessionCookieImpl.useApplicationModule(SessionCookieImpl.java:419)
    07/05/05 13:48:14      at oracle.adf.model.bc4j.DCJboDataControl.rebuildApplicationModule(DCJboDataControl.java:1536)
    07/05/05 13:48:14      at oracle.adf.model.bc4j.DCJboDataControl.beginRequest(DCJboDataControl.java:1396)
    07/05/05 13:48:14      at oracle.adf.model.binding.DCDataControlReference.getDataControl(DCDataControlReference.java:99)
    07/05/05 13:48:14      at oracle.adf.model.BindingContext.get(BindingContext.java:457)
    07/05/05 13:48:14      at com.sun.faces.el.PropertyResolverImpl.getValue(PropertyResolverImpl.java:79)
    07/05/05 13:48:14      at oracle.adfinternal.view.faces.model.FacesPropertyResolver.getValue(FacesPropertyResolver.java:92)
    07/05/05 13:48:14      at com.sun.faces.el.impl.ArraySuffix.evaluate(ArraySuffix.java:187)
    07/05/05 13:48:14      at com.sun.faces.el.impl.ComplexValue.evaluate(ComplexValue.java:171)
    07/05/05 13:48:14      at com.sun.faces.el.impl.ExpressionEvaluatorImpl.evaluate(ExpressionEvaluatorImpl.java:263)
    07/05/05 13:48:14      at com.sun.faces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:160)
    07/05/05 13:48:14      ... 37 more

    Hi,
    I don't know where is the problem - it works for me. Check precisely database connection (about JBO-30003 see: http://blogs.oracle.com/jheadstart/newsItems/departments/adfBusinessComponents/2006/08/18).
    Also note, what kind of file you are uploading. In MimeTypes class there are definitions for mime types.
    Kuba

  • Unable to upload document in oracle blob

    In our project it's needed to attach docs in the oracle DB, so that user can read it from the DB through aplication itself.
    my project is running on Weblogic 8.1 & jdk 1.4
    I am using the following code for uploading 7 downloading.
    public static boolean upload(Connection cncDB, int leadID,FormFile myFile,int pageID){
              boolean flag=true;
              ResultSet rslStDB = null;
              PreparedStatement prpStDB = null;
              try{
                   byte[] fileData = myFile.getFileData();
                   oracle.sql.BLOB blobObj=null;
                   if(pageID==1){
                   prpStDB=cncDB.prepareStatement("select pitchdoc from m_deal where leadid="+leadID+" and activeflag=1 for update");
                   else{
                   prpStDB = cncDB.prepareStatement("select scanDocs from t_file_login_ops where leadid='" + leadID + "' for update");
                   rslStDB=prpStDB.executeQuery();
                   if (rslStDB.next()){
                        blobObj=(oracle.sql.BLOB)rslStDB.getBlob(1);
                   OutputStream out=blobObj.getBinaryOutputStream();
                   out.write(fileData);
                   if(out!=null){out.close();}
         catch (NullPointerException ne) {
              flag=false;
              logger.error("NullPointerException " + ne.getMessage());
         } catch (Exception e) {
              flag=false;
              logger.error("Exception " + e.getMessage());
         } finally {
              // No need to close the connection
              DBConnectionHandler.releaseConnection(null, null, prpStDB);
         return flag;
         * @param selectedLeadID : leadID of the deal
         * @return
         public static byte[] downloadPitchDocs(String selectedLeadID,int pageID) {
         Connection cncDB = null;
         PreparedStatement prpStDB = null;
         ResultSet rslt = null;
         byte[] fileBytes = null;
         logger.info("Given ID In DAO is:" + selectedLeadID);
         try {
         cncDB = DBConnectionHandler.getConnectionDashboard();
         StringBuffer sbQuery = new StringBuffer(500);
         if(pageID==1){
         sbQuery.append("SELECT PITCHDOC from M_DEAL where leadid='" +
         selectedLeadID + "'");
         sbQuery.append(" and activeflag=1");
         prpStDB = cncDB.prepareStatement(sbQuery.toString());
         else{
              sbQuery.append("SELECT scandocs from T_FILE_LOGIN_OPS where leadid="+selectedLeadID+"");
              prpStDB = cncDB.prepareStatement(sbQuery.toString());
         logger.info("DownLoad:" + sbQuery.toString());
         rslt = prpStDB.executeQuery();
         while (rslt.next()) {
         //InboxVO inboxVO = new InboxVO();
         Blob blob = rslt.getBlob(1);
         fileBytes = blob.getBytes(1, (int) blob.length());
         } catch (NullPointerException ne) {
         logger.error("NullPointerException " + ne.getMessage());
         } catch (SQLException se) {
         logger.error("SQLException " + se.getMessage());
         } catch (Exception e) {
         logger.error("Exception " + e.getMessage());
         } finally {
         DBConnectionHandler.releaseConnection(cncDB, rslt, prpStDB);
         return fileBytes;
    when i executed the application it's downloading but not uploading. don't know why.............
    Please help me, how to upload in blob in weblogic 8.1 with jdk 1.4??????????

    Dear Nishad,
    Keeping objects in external content repository is not a good idea if there is a possibility that the objects can be transported to another system where they need to be used as well. The transport just copies the link to the new system. So 2 systems then are able to work with same object. When one system changes the object and saves it as the same version then other system will not be able to access it  because it still has the old keys to access the object while the keys have been changed.
    Changing the model and saving it basically creates a new PHIO and deletes the old PHIO and object content key is the new PHIO id which is now present only in one system . Hence, the issue in the other system.
    You can transport the record model from sandbox to production and then change the repository in sandbox system so that the sandbox system does not access the repository accessed by production system.
    If the record model in its current form in sandbox is not required in production( if you need the old record model in production) then please check if there are old versions available for the record model in production system using SRMGS_DOCTOOL OR in any other system(ref: http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b067767a-4394-2e10-1bbe-f6ab8ec7331f?QuickLink=index&overridelayout=true&51586852254984 ) . You will need to delete later versions so that the version you need is the current version of the record model( and transport to production if the production does not have old versions either).
    Best Regards,
    Pragya

  • Character set is lost during uploading file to blob?

    Hi!
    When I upload file from a disk to htmldb_application_files it is stored there as a blob. Then when I convert this blob to clob, with proper character set id as a parameter, characters in clob are not correct. They loose seriffs etc.
    The question is : What happens with characters during uploading to blob?
    Thanks!

    Hi!
    When I upload file from a disk to htmldb_application_files it is stored there as a blob. Then when I convert this blob to clob, with proper character set id as a parameter, characters in clob are not correct. They loose seriffs etc.
    The question is : What happens with characters during uploading to blob?
    Thanks!

Maybe you are looking for

  • Branch Office for Webtogo Apps

    Does Branch Office support Webtogo Apps? This would help with initial download times if a sync could be made to a Branch Office machine and then have local downloads by clients.

  • Raw files in iPhoto

    I see several discussions on this, and TD your responses have helped me a bit. I am still a little confused. What I want to do is continue to use iPhoto, and edit in iPhoto sometimes, but I want my raw files saved as raw files so I can open them in P

  • PC Design Standard Activation on Additional Computers

    I purchased Design Standard CS6 in 2012 and installed it onto my laptop, and registered its serial number in my Adobe ID. I am trying to reinstall the same software on my desktop now. This has been successful up until the point where when I open Phot

  • Desktop picture disappears

    10.5.3 on a macbook pro 2.6ghz. I was importing a few hundred pictures in nikon raw format into iphoto. Midway through the import, the existing desktop picture I had set reverted back to the default mac background. I can change it at any time, but if

  • Saving music on an ipod that previous owner dowloaded from their itunes account

    I was given an Ipod Nano 2nd generation as a gift several years ago.  There are 181 songs on the ipod all of which were downloaded from someone elses itunes account.  I don't know itunes Id or password & I don't have an itunes accounts.  How can i ba