File System or BLOB

Hi,
I have wrote an application and all works well. I was wondering what peoples views are on the BLOB in Database vs File System argument? I have gone for the BLOB method as I like the security and ease of it. What I don't like is the more the system is used, my hosting costs begin to rise!! :(
How is everyone else handling files in their systems? Will the introduction of APERX 4.0 with the new listener have any impact on your decision (I read it has better file handling but I have not investigated too much)?
Just looking for a bit of guidance on which way is the Best Practise for this.
Thanks
Richard

Best thing that could be said.. Read this thread on Asktom.com and your questions should be answered..:http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1011065100346196442
Thank you,
Tony Miller
Webster, TX

Similar Messages

  • How do you move blob content in a table out to the server file system

    Hi,
    I have a table that contains a blob column containing word and pdf documents I want to be able to take content such as a pdf held in the blob column and move a copy of the pdf to the servers file system. Can it be done.
    Thanks in anticipation.
    SDG

    There is no Monitoring SQL Activity, so we Need to find other Solutions.
    1: can be this Integration Pack:
    http://www.kelverion.com/integration_packs/ip-sql-server/
    2: Create a Trigger in SQL Side, which will Trigger a Runbook
    3: Query every ? 5 ? Minutes the Table,  compare to a sample Table and get the new Informations
    Seidl Michael | http://www.techguy.at |
    twitter.com/techguyat | facebook.com/techguyat

  • Need to Move contents of BLOB from database to middle-tier file system

    I need to be able to move the contents of a BLOB (which is a PDF file) from the database to a specified location in the middle-tier file system (running 9iAS). There does not seem to be the equivalent package or other built-in functionality to DBMS_LOB (for moving INTO the database, which is amazing. Does anyone have a java bean or (?) which can accomplish this simingly simple task??

    The java bean should work to extract from the database to a binary file on either Unix or Windows. As long as the file is in .bmp format in the database, you can save the file as .bmp on you file system and everything should be alright.
    Or, perhaps, am I not understanding your question?
    Good Luck
    Eric Kamradt

  • Exctract a BLOB to file system

    Hello,
    I've saved some archives (PDFs, DOCs) in a BLOB Field with Initialize_Container built-in.
    How could I extract these archives to file system ? (inverse operation).
    Thanks. Regards.

    It depends on what OLE automation interfaces Acrobat Reader supports - you may need the full version of acrobat to do any decent manipulation.

  • Extracting file from blob and storing in file system

    In order to keep the database size down, I would like to run a program to execute on submit of a page containing a file upload control, which will extract the file from the blob in the db and store it in the operating system.
    Any suggestions on how I can accomplish this?

    I use something like this
      procedure blob2file
        ( p_blob blob
        , p_directory varchar2 := 'MY_DIR'
        , p_filename varchar2 := 'my.xlsx'
      is
        t_fh utl_file.file_type;
        t_len pls_integer := 32767;
      begin
        t_fh := utl_file.fopen( p_directory
                              , p_filename
                              , 'wb'
        for i in 0 .. trunc(  ( dbms_lob.getlength( p_blob ) - 1 ) / t_len )
        loop
          utl_file.put_raw( t_fh
                          , dbms_lob.substr( p_blob
                                           , t_len
                                           , i * t_len + 1
        end loop;
        utl_file.fclose( t_fh );
      end;Anton

  • LONG_RAW conversion (using OLE) to file system then import into BLOB column

    To whom it may concern (I will call "hero" or "savior" if you can solve this for me),
    I posted this message an another thread; but then later thought it would be better in its own thread.
    I was wondering how to extract the Adobe Acrobat Reader files (PDF) from OLE component stored in a LONG_RAW database column. I was able to successfully extract the MS-Word, MS-Excel, MS-Powerpoint, and MS-Project to the operating system. I was not able to extract the Adobe PDF files. The PDF files do not return an error message nor do they write out to the file system?
    Leonid previous posted some suggestions on how to convert the data. Can anyone expand on tasks #4 and #5 (see below)?
    You can use this library to do the following task:
    1. Get the type of an object stored inside OLE Item. Get information about the OLE server.
    GetCLSID, GetProgID, IsIDispatchSupported
    2. Get information about the object
    IsLinked, GetSourceDisplayName
    3. Get information from the object in formats supported by its IDataObject interface.
    EnumFormatEtc, RegClipFormat, GetData
    I suppose it's the best way to extract pictures!
    4. Save the object into an external file throu IPersistFile interface. It works only if IPersistFile::Save method is implemented by the OLE server. Unfortunately, some OLE servers don't support this method even don't return a correct error code.
    SaveToFile
    Works with: MS Word, MS Excel
    Not works with: Adobe Acrobat (I'm not sure. Maybe I've done something wrong), MS Photo Editor
    5. Extract the 'Contents' stream from a structured storage /a compound document/.
    ExtractToFile
    It isn't a documented way, but it can be used to extract PDF files.
    I have tried the following two scenarios for the PDF extraction:
    -- First Attempt
    ret:=OLEXTRA.SaveToFile( application, v_FILENAME_WO_EXT || '.pdf' );
    if ret <> 0 then
    show_message( 'SaveToFile Error code='||ret );
    end if;
    -- application does not return an error message
    -- application does not save the PDF file to the operating system.
    -- Second Attempt
    ret:=OLEXTRA.ExtractToFile( application, 'stg.pdf', 'fname.pdf' );
    if ret <> 0 then
    show_message( 'ExtractToFile Error code='||ret );
    end if;
    -- application does not return an error message.
    -- application does not save fname.pdf to the operating system
    -- application saves the stg.pdf to file system, but cannot open in Adobe
    Thanks in advance for the help,
    Mike

    There is no way from PL/SQL in Forms - you'll have to call out to C or Java Code to do it.
    You can link in Pro*C or OCI code into forms as a user exit in which case it can share the forms connection but that's not for the faint hearted.
    Using Java - called from the Java Importer feature in 6i+ you'll end up creating a separate connection.
    Frankly if you can do it in a generic enough way through a VB executable stick with that.
    Forms can get images in an out of a long raw using read_image_file and write_image_file but that does not extend to any binary file - just images.

  • Store \ Retrieve files from file system

    Hi to all!
    I would like to implement a solution for storing files uploaded via apex user interface to servers file system. As well I would like this files to be retrievable by apex users. I designed the following solution:
    For upload:
    1. Through file browse item user chooses file to be uploaded
    2. File goes to custom table (as BLOB)
    -- so far i would use apex Upload\Download files tutorial
    3. File(BLOB) would then have to be written to file system to some directory and file id would have to be written to some db table which holds pointers to files on file system
    4. delete file(blob) from custom table (from step 2)
    For download:
    1. user chooses link from some report region(based on table giving file pointers to files residing on file system)
    2. file identified with chosen file pointer is then inserted into blob column of some custom table in db
    3. from custom table with download procedure fie is finally presented to user
    4. delete file(blob) from custom table (from step 2)
    Using apex tutorial for Upload\Download files it is straitforward to get the files from db table or into db table using blobs. But i have not seen any example of using BFILE or migrating files from db to file system and vice versa.
    So some Q arise:
    a) How can I implement step 3 under For upload section above
    b) How can I implement step 2 under For download section above
    c) Is there any way to directly upload file to file system via apex user interface or to directly download file from file system via some report region link column?
    Please help!!!
    Regards Marinero
    Message was edited by:
    marinero

    marinero,
    Here is a procedure that will copy an uploaded file to the file system:
      Procedure BLOB_TO_FILE(p_file_name In Varchar2) Is
        l_out_file    UTL_FILE.file_type;
        l_buffer      Raw(32767);
        l_amount      Binary_Integer := 32767;
        l_pos         Integer := 1;
        l_blob_len    Integer;
        p_data        Blob;
        file_name  Varchar2(256);
      Begin
        For rec In (Select ID
                              From HTMLDB_APPLICATION_FILES
                             Where Name = p_file_name)
        Loop
            Select BLOB_CONTENT, filename Into p_data, file_name From HTMLDB_APPLICATION_FILES Where ID = rec.ID;
            l_blob_len := DBMS_LOB.getlength(p_data);
            l_out_file := UTL_FILE.fopen('UPDOWNFILES_DIR', file_name, 'wb', 32767);
            While l_pos < l_blob_len
            Loop
              DBMS_LOB.Read(p_data, l_amount, l_pos, l_buffer);
              If l_buffer Is Not Null Then
                UTL_FILE.put_raw(l_out_file, l_buffer, True);
              End If;
              l_pos := l_pos + l_amount;
            End Loop;
            UTL_FILE.fclose(l_out_file);
        End Loop;         
      Exception
        When Others Then
          If UTL_FILE.is_open(l_out_file) Then
            UTL_FILE.fclose(l_out_file);
          End If;
      end; And here is a procedure that will download a file directly from the file system:
      Procedure download_my_file(p_file In Number) As
        v_length    Number;
        v_file_name Varchar2(2000);
        Lob_loc     Bfile;
      Begin
        Select file_name
          Into v_file_name
          From UpDownFiles F
         Where File_id = p_file;
        Lob_loc  := bfilename('UPDOWNFILES_DIR', v_file_name);
        v_length := dbms_lob.getlength(Lob_loc);
        owa_util.mime_header('application/octet', False);
        htp.p('Content-length: ' || v_length);
        htp.p('Content-Disposition: attachment; filename="' || SUBSTR(v_file_name, INSTR(v_file_name, '/') + 1) || '"');
        owa_util.http_header_close;
        wpg_docload.download_file(Lob_loc);
      End download_my_file;I could put a sample application on apex.oracle.com, but it wouldn't be able to access the file system on that server.

  • How to insert a JPG file from file system to Oracle 10g?

    I have developed a schema to store photos as BLOB which store the text description as CLOB original filename, file size.
    I also use ctxsys.context to index TEXT_DESCRIPTION in order to perform Oracle Text Search and it works.
    I would like to insert some JPG file from say C:\MYPHOTO\Photo1.jpg as a new record. How can I do this in SQL PLus and/or Loader?
    How can I retrieve the PHOTO_IMAGE back to the file system using SQL Plus and/or command line in DOS?
    See the following script:
    create user myphoto identified by myphoto;
    grant connect, resource, ctxapp to myphoto;
    connect myphoto/myphoto@orcl;
    PROMPT Creating Table PHOTOS
    CREATE TABLE PHOTOS
    (PHOTO_ID VARCHAR2(15) NOT NULL,
    PHOTO_IMAGE BLOB,
    TEXT_DESCRIPTION CLOB,
    FILENAME VARCHAR2(50),
    FILE_SIZE NUMBER NOT NULL,
    CONSTRAINT PK_PHOTOS PRIMARY KEY (PHOTO_ID)
    create index idx_photos_text_desc on
    PHOTOS(TEXT_DESCRIPTION) indextype is ctxsys.context;
    INSERT INTO PHOTOS VALUES
    ('P00000000000001', empty_blob(), empty_clob(),
    'SCGP1.JPG',100);
    INSERT INTO PHOTOS VALUES
    ('P00000000000002', empty_blob(), 'Cold Play with me at the concert in Melbourne 2005',
    'COLDPLAY1.JPG',200);
    INSERT INTO PHOTOS VALUES
    ('P00000000000003', empty_blob(), 'My parents in Melbourne 2001',
    'COLDPLAY1.JPG',200);
    EXEC CTX_DDL.SYNC_INDEX('idx_photos_text_desc');
    SELECT PHOTO_ID ,TEXT_DESCRIPTION
    FROM PHOTOS;
    SELECT score(1),PHOTO_ID ,TEXT_DESCRIPTION
    FROM PHOTOS
    WHERE CONTAINS(TEXT_DESCRIPTION,'parents',1)> 0
    ORDER BY score(1) DESC;
    SELECT score(1),PHOTO_ID ,TEXT_DESCRIPTION
    FROM PHOTOS
    WHERE CONTAINS(TEXT_DESCRIPTION,'cold play',1)> 0
    ORDER BY score(1) DESC;
    SELECT score(1),score(2), PHOTO_ID ,TEXT_DESCRIPTION
    FROM photos
    WHERE CONTAINS(TEXT_DESCRIPTION,'Melbourne',1)> 0
    AND CONTAINS(TEXT_DESCRIPTION,'2005',2)> 0
    ORDER BY score(1) DESC;

    Hi
    You can use the following to insert an image:
    create table imagetab(id number primary key,imagfile blob, fcol varchar2(10));
    create or replace directory imagefiles as 'c:\'
    declare
        v_bfile BFILE;
        v_blob  BLOB;
      begin
        insert into imagetab (id,imagfile,fcol)
        values (3,empty_blob(),'BINARY')
        return imagfile into v_blob;
        v_bfile := BFILENAME ('IMAGEFILES', 'MyImage.JPG');
        Dbms_Lob.fileopen (v_bfile, Dbms_Lob.File_Readonly);
        Dbms_Lob.Loadfromfile (v_blob, v_bfile, Dbms_Lob.Getlength(v_bfile));
        Dbms_Lob.Fileclose(v_bfile);
        commit;
      end;
    /

  • An IOException thrown when I try to upload a file to my blob container

    Hi all, when I using Java to upload a FLV to my free trial storage account, an IOException occurs, can anybody tell me what's the reason for this problem? and how to solve this problem?
    // Dependency in my project.
    <dependency>
        <groupId>com.microsoft.windowsazure</groupId>
        <artifactId>microsoft-windowsazure-api</artifactId>
        <version>0.4.4</version>
    </dependency>
    // The source code used for uploading a file.
    public static void upload(String containerName, File localFile, String blobAddressUri) throws URISyntaxException,
    StorageException, InvalidKeyException, FileNotFoundException, IOException {
    long startTime = System.currentTimeMillis();
    // Retrieve storage account from connection-string.
    CloudStorageAccount storageAccount = CloudStorageAccount.parse(STORAGE_CONNECTION_STRING);
    // Create the blob client.
    CloudBlobClient blobClient = storageAccount.createCloudBlobClient();
    // Get a reference to a container.
    // The container name must be lower case.
    CloudBlobContainer container = blobClient.getContainerReference(containerName);
    if (!container.exists()) {
    // Create the container if it does not exist.
    createContainer(containerName);
    // Create or override the "myvideo.avi" blob with contents from a local file.
    CloudBlockBlob blob = container.getBlockBlobReference(blobAddressUri);
    try {
    blob.upload(new FileInputStream(localFile), localFile.length());
    } catch (Exception e) {
    // Retry again 2 seconds later.
    try {
    Thread.sleep(2000L);
    } catch (InterruptedException ie) {
    // LOG.error("2秒后重试一次", ie);
    blob.upload(new FileInputStream(localFile), localFile.length());
    long endTime = System.currentTimeMillis();
    LOG.info("Uploaded file '{}' (length={}) to Azure, startTime={}, endTime={}, elpased={} ms", new Object[] {
    localFile.getAbsoluteFile(), localFile.length(), startTime, endTime, (endTime - startTime) });
    java.io.IOException
            at com.microsoft.windowsazure.services.core.storage.utils.Utility.initIOException(Utility.java:563)
            at com.microsoft.windowsazure.services.blob.client.BlobOutputStream$1.call(BlobOutputStream.java:377)
            at com.microsoft.windowsazure.services.blob.client.BlobOutputStream$1.call(BlobOutputStream.java:361)
            at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
            at java.util.concurrent.FutureTask.run(FutureTask.java:138)
            at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
            at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
            at java.util.concurrent.FutureTask.run(FutureTask.java:138)
            at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
            at java.lang.Thread.run(Thread.java:662)
    Caused by: com.microsoft.windowsazure.services.core.storage.StorageException: The server encountered an unknown failure:
            at com.microsoft.windowsazure.services.core.storage.StorageException.translateException(StorageException.java:120)
            at com.microsoft.windowsazure.services.core.storage.utils.implementation.ExecutionEngine.executeWithRetry(ExecutionEngine.ja
    va:166)
            at com.microsoft.windowsazure.services.blob.client.CloudBlockBlob.uploadBlockInternal(CloudBlockBlob.java:645)
            at com.microsoft.windowsazure.services.blob.client.CloudBlockBlob.uploadBlock(CloudBlockBlob.java:582)
            at com.microsoft.windowsazure.services.blob.client.BlobOutputStream$1.call(BlobOutputStream.java:365)
            ... 9 more
    Caused by: java.io.IOException: Error writing to server
            at sun.net.www.protocol.http.HttpURLConnection.writeRequests(HttpURLConnection.java:578)
            at sun.net.www.protocol.http.HttpURLConnection.writeRequests(HttpURLConnection.java:590)
            at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1193)
            at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:379)
            at com.microsoft.windowsazure.services.core.storage.utils.implementation.ExecutionEngine.processRequest(ExecutionEngine.java
    :332)
            at com.microsoft.windowsazure.services.blob.client.CloudBlockBlob$3.execute(CloudBlockBlob.java:633)
            at com.microsoft.windowsazure.services.blob.client.CloudBlockBlob$3.execute(CloudBlockBlob.java:613)
            at com.microsoft.windowsazure.services.core.storage.utils.implementation.ExecutionEngine.executeWithRetry(ExecutionEngine.ja
    va:112)
            ... 12 more

    Hi I am also getting the same IO Exception error.
    15/01/07 09:07:13 INFO mapreduce.Job: Task Id : attempt_1420542176512_0075_m_000234_0, Status : FAILED
    Error: java.io.IOException
                    at com.microsoft.windowsazure.storage.core.Utility.initIOException(Utility.java:493)
                    at com.microsoft.windowsazure.storage.blob.BlobOutputStream$1.call(BlobOutputStream.java:370)
                    at com.microsoft.windowsazure.storage.blob.BlobOutputStream$1.call(BlobOutputStream.java:354)
                    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
                    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
                    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
                    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
                    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
                    at java.lang.Thread.run(Thread.java:745)
    Caused by: com.microsoft.windowsazure.storage.StorageException: The server encountered an unknown failure:
                    at com.microsoft.windowsazure.storage.StorageException.translateException(StorageException.java:179)
                    at com.microsoft.windowsazure.storage.core.ExecutionEngine.executeWithRetry(ExecutionEngine.java:266)
                    at com.microsoft.windowsazure.storage.blob.CloudBlockBlob.uploadBlockInternal(CloudBlockBlob.java:717)
                    at com.microsoft.windowsazure.storage.blob.CloudBlockBlob.uploadBlock(CloudBlockBlob.java:688)
                    at com.microsoft.windowsazure.storage.blob.BlobOutputStream$1.call(BlobOutputStream.java:358)
                    ... 7 more
    Caused by: java.io.IOException: Error writing to server
                    at sun.net.www.protocol.http.HttpURLConnection.writeRequests(HttpURLConnection.java:625)
                    at sun.net.www.protocol.http.HttpURLConnection.writeRequests(HttpURLConnection.java:637)
                    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1321)
                    at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:468)
                    at com.microsoft.windowsazure.storage.core.ExecutionEngine.executeWithRetry(ExecutionEngine.java:176)
                    ... 10 more
    Please Help

  • Uploaded Files stored in Oracle 10G database or in Unix File system

    Hey All,
    I am trying to understand best practices on storing uploaded files. Should you store within the database itself (this is the current method we are using by leveraging BLOB storage) or use a BFILE locator to use the files system storage (we have our DB's on UNIX) . . .or is there another method I should be entertaining? I have read arguments on both sides of this question. I wanted to see what answers forum readers could provide!! I understand there are quite a few factors but the situation I am in is as follows:
    1) Storing text and pdf documents.
    2) File sizes range from a few Kb to up to 15MB in size
    3) uploaded files can be deleted and updated / replaced quite frequently
    Right now we have an Oracle stored procedure that is uploading the files binary data into a BLOB column on our table. We have no real "performance" problems with this method but are entertaining the idea of using the UNIX file system for storage instead of the database.
    Thanks for the insight!!
    Anthony Roeder

    Anthony,
    First word you must learn here in this forum is RESPECT.
    If you require any further explanation, just say so.
    BLOB compared with BFILE
    Security:
    BFILEs are inherently insecure, as insecure as your operating system (OS).
    Features:
    BFILEs are not writable from typical database APIs whereas BLOBs are.
    One of the most important features is that BLOBs can participate in transactions and are recoverable. Not so for BFILEs.
    Performance:
    Roughly the same.
    Upping the size of your buffer cache can make a BIG improvement in BLOB performance.
    BLOBs can be configured to exist in Oracle's cache which should make repeated/multiple reads faster.
    Piece wise/non-sequential access of a BLOB is known to be faster than a that of a BFILE.
    Manageability:
    Only the BFILE locator is stored in an Oracle BACKUP. One needs to do a separate backup to save the OS file that the BFILE locator points to. The BLOB data is backed up along with the rest of the database data.
    Storage:
    The amount of table space required to store file data in a BLOB will be larger than that of the file itself due to LOB index which is the reason for better BLOB performance for piece wise random access of the BLOB value.

  • STORE A COMPLETE FILE SYSTEM IN THE DATABASE 11GR2

    Hi everyone
    I have the following issue:
    I tried to store in an oracle database TABLE the completre file structure
    of a file system that includes the follwing:
    -Name of the file
    -Date of last modification
    -Location
    -The entire content of the phisical file BLOB datatype
    I have the following piece of code to archieve this, but i still have a
    problem...
    When i tried to add the records to the database by implememting all
    the connecttions stuffs, oracle and java classes required the program
    inserts a FEW RECORDS and after that:
    ¡¡¡hangs up!!!.
    The main problem is that i cant release the connection and get another new when i using
    JDBC POOL so the server full their available connections.
    Please tell me what is the best approach or programming practice on order to
    meet this goal.
    Thanks from Colombia - Latin America..
    HERE IS THE CODE:
    import java.io.* ;
    * A simple class to demonstrate a recursive directory traversal
    * in Java.
    * Error handling was left out to make the code easier to understand.
    * In production code, you should check if the arguments from the
    * command line are really file files or directories.
    public class RecursiveTraversal
    * Works on a single file system entry and
    * calls itself recursively if it turns out
    * to be a directory.
    * @param file A file or a directory to process
    public void traverse( File file )
    // Print the name of the entry
    //System.out.println( file ) ;
    // Check if it is a directory
    if( file.isDirectory() )
    // Get a list of all the entries in the directory
    String entries[] = file.list() ;
    // Ensure that the list is not null
    if( entries != null )
    // Loop over all the entries
    for( String entry : entries )
    // Recursive call to traverse
    traverse( new File(file,entry) ) ;
    else
    if(file.isFile())
    System.out.println( file.getParent() ) ;
    System.out.println( file.getName() ) ;
    else
    System.out.println("*** WRONG VALUE ***");
    * The program starts here.
    * @param args The arguments from the command line
    public static void main( String args[] )
    // Create an object of this class
    RecursiveTraversal rt = new RecursiveTraversal() ;
    if( args.length == 0 )
    // If there are no arguments, traverse the current directory
    rt.traverse( new File(".") ) ;
    else
    // Else process every argument sequentially
    for( String arg : args )
    rt.traverse( new File(arg) ) ;
    }

    Thanks for the reply, the implementation that you refer is useful for another type of application i need to stored the file system in a TABLE of a database
    in order to make a part of an information system integration and can use SQL statements to acomplish this.
    I follow the recomendation and post it in the SQL/JDBC forum because when i try to release de active connection i can't acomplish this.
    And i need to know how to use JDBC connection poolling to open a connection just once, release and use it again.

  • How to batch upload PDF files into database BLOB

    Hello.
    I have a requirement to batch upload PDF files into BLOB column of an Oracle 8.1.7 table from Forms 6i Web. The content of the blob column (ie. the PDF content) MUST be displayable from all client software (eg. Oracle Web forms, HTML forms, etc.)
    Our environment is
    Middle-tier is 9iAS on Windows/2000
    Database is Oracle 8.1.7.0.0 on VMS
    Oracle Web Forms 6i Patch 10
    Basically my Oracle web form program will display a list of PDF files to upload and then the user can click on the &lt;Upload&gt; button to do the batch upload. I have experimented the following approaches but with no luck.
    1. READ_IMAGE_FILE forms built-in = does NOT work because it cannot read PDF file. I got error FRM-47100: Cannot read image file
    2. OCX and OLE form item = cannot use this because it does NOT work on the Web. I got error FRM-41344 OLE object not defined
    3. I cannot use DBMS_LOB to do the load because the PDF files are not in the database machine.
    4. Metalink Note 1682771.1 (How to upload binary documents back to database blob column from forms). When I used this, I got ORA-6502 during the hextoraw conversion. In using this solution, I have downloaded a bin2hex.exe from the Google site. I've noticed that when I looked at the converted HEX file, each line has the character : (colon) at the beginning of each line. I know the PDF file has been converted correctly to HEX format because when I convert the HEX file back to BIN format using hex2bin.exe, I'm able to display the converted bin file in Acrobat Reader. When I removed the : (colon) in the HEX file, I did NOT get the ORA-6502 error but I CANNOT display the file in Acrobat Reader. It gives an error "corrupted file".
    5. upload facility in PL/SQL Web toolkit - I tried to automatically submit the html form (with htp.p) but it does NOT load the contents of the file. I called the URL from Oracle forms using web.show_document. There seems to be issues with Oracle Web forms (JInitiator) and HTML (+ htp.p).
    The other options I can think of at this point are:
    1. Use SQL*Loader to do the batch upload via SQL*Net connection and use HOST() built-in from Oracle Webforms to execute SQL*Loader from the 9iAS.
    2. Write a Visual Basic program that reads a binary file and output the contents of the file into a byte array. Then build a DLL that can be called from Oracle webforms 6i via ORA_FFI. I don't prefer this because it means the solution will only work for Windows.
    3. Write a JSP program that streams the PDF file and insert the contents of the PDF file into blob column via JDBC. Call JSP from forms using web.show_document. With this I have to do another connection to the database when I load the file.
    4. Maybe I can use dbms_lob by using network file system (NFS) between the application server and VMS. But this will be network resource hungry as far as I know because the network connection has to be kept open.
    Please advise. Thank you.
    Regards,
    Armando

    I have downloaded a bin2hex.exe from the Google site.
    ... each line has the character : (colon) at the
    beginning of each line. I'm afraid it isn't a correct utility. I hope you'll find the source code of a correct one at metalink forum:
    Doc ID: 368771.996
    Type: Forum
    Subject: Uploading Binary Files: bin2hex and hex2bin do not reproduce the same file
    There is some links to metalink notes and some example about working with BLOB at http://www.tigralen.spb.ru/oracle/blob/index.htm. Maybe it helps. Sorry for my English. If there is any problem with code provided there, let me know by e-mail.

  • Store large volume of Image files, what is better ?  File System or Oracle

    I am working on a IM (Image Management) software that need to store and manage over 8.000.000 images.
    I am not sure if I have to use File System to store images or database (blob or clob).
    Until now I only used File System.
    Could someone that already have any experience with store large volume of images tell me what is the advantages and disadvantages to use File System or to use Oracle Database ?
    My initial database will have 8.000.000 images and it will grow 3.000.000 at year.
    Each image will have sizes between 200 KB and 8 MB, but the mean is 300 KB.
    I am using Oracle 10g I. I read in others forums about postgresql and firebird, that isn't good store images on database because always database crashes.
    I need to know if with Oracle is the same and why. Can I trust in Oracle for this large service ? There are tips to store files on database ?
    Thank's for help.
    Best Regards,
    Eduardo
    Brazil.

    1) Assuming I'm doing my math correctly, you're talking about an initial load of 2.4 TB of images with roughly 0.9 TB added per year, right? That sort of data volume certainly isn't going to cause Oracle to crash, but it does put you into the realm of a rather large database, so you have to be rather careful with the architecture.
    2) CLOBs store Character Large OBjects, so you would not use a CLOB to store binary data. You can use a BLOB. And that may be fine if you just want the database to be a bit-bucket for images. Given the volume of images you are going to have, though, I'm going to wager that you'll want the database to be a bit more sophisticated about how the images are handled, so you probably want to use [Oracle interMedia|http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14302/ch_intr.htm#IMURG1000] and store the data in OrdImage columns which provides a number of interfaces to better manage the data.
    3) Storing the data in a database would generally strike me as preferrable if only because of the recoverability implications. If you store data on a file system, you are inevitably going to have cases where an application writes a file and the transaction to insert the row into the database fails or a the transaction to delete a row from the database succeeds before the file is deleted, which can make things inconsistent (images with nothing in the database and database rows with no corresponding images). If something fails, you also can't restore the file system and the database to the same point in time.
    4) Given the volume of data you're dealing with, you may want to look closely at moving to 11g. There are substantial benefits to storing large objects in 11g with Advanced Compression (allowing you to compress the data in LOBs automatically and to automatically de-dupe data if you have similar images). SecureFile LOBs can also be used to substantially reduce the amount of REDO that gets generated when inserting data into a LOB column.
    Justin

  • Upload file in to file system using Apex

    Hi...
    I have tried UTL_FILE to upload file in Directory. But First i have to upload file in Table in BLOB datatype and then copy it to file system using BFILE.
    I have to store files in file system as per requirements.
    I want to upload file directly to File System. Suggest me the right way...
    Thank You in advance........
    Edited by: user639262 on Aug 28, 2008 2:11 PM

    Apex only supports upload into a table.
    If you want to upload directly to the file system you should look into the possibilities of your application server. Maybe you could find a piece of code in Java or PHP that performs an upload.
    good luck, DickDral

  • Procedure to Insert PDF from FIle System to Database

    Hi ,
    I have a requirement to put the pdf files from our Local Machine or File system into Database table ..
    For that I have created a directory called "MY_PDF" with create and replace directory .
    Also , I have created a database table to store the files from Local machine FIle System directory ( MY_PDF) .
    I have created a procedure which takes 2 inputs ( ID and FIlename ) as parameters , this procedure when executes , it insert the file along with the ID in the database table .
    Procedure is as follows :
    CREATE OR REPLACE PROCEDURE proc_load_a_file( p_id IN NUMBER, p_filename IN VARCHAR2 )
    AS
    l_blob BLOB;
    l_bfile BFILE;
    x VARCHAR2(1000);
    BEGIN
    x:=p_filename;
    INSERT INTO demo(id,theblob,filename) VALUES ( p_id, empty_blob() ,x)
    RETURNING theBlob INTO l_blob;
    UPDATE demo
    SET locater =l_blob where id=p_id;
    l_bfile := bfilename( 'MY_FILES', p_filename );
    DBMS_LOB.FILEOPEN( l_bfile );
    DBMS_LOB.LOADFROMFILE( l_blob, l_bfile,
    DBMS_LOB.getlength( l_bfile ) );
    DBMS_LOB.fileclose( l_bfile );
    COMMIT;
    END;
    Now , my requirement is not to insert one one file each and every time when I execute the procedure .
    My requirement is first to check the File system Directory (MY_PDF) . If
    there is any pdf file in the directory then it will call that procedure and insert that file into the database untill no files found in the dorectory ( MY_PDF) .
    I am not getting the idea how to do this ..
    Please someone provide some valueable inputs .. so that I can finish it up .
    Thanks
    Prashant Dwivedi

    Suggest using the FlowElement.setStyle method to attach additional information about the image to the InlineGraphicElement that gets created.  Looking at the example code in the posted link you'll need to pass that data to the imageLoadComplete method.  The InlineGraphicElement can be found by saving interactionManager.absoluteStart before the graphic is inserted and then calling textFlow.findLeaf(savedAbsoluteStart).
    Hope that helps,
    Richard

Maybe you are looking for

  • Finding a printer shared from 10.3.9 on 10.5.6

    i have seen the support page at _http://support.apple.com/kb/HT2275_ that suggests using cupsctl to configure the cupsd.conf to search for my printer being shared by my PPC-based mac running 10.3.9 on my other macs running 10.5. unfortunately, upon t

  • Issue when trying to upgrade FB 4.7 to AIRDSK 3.6

    Hi, I'm desperately trying to upgrade FB 4.7 to AIRSDK 3.6 since 3 weeks. I've followed the various solutions found on forums and the various processes displayed by the "helpx.adobe.com" pages, but none of them works. So please, if a member of Adobe

  • Playback jumpy -- only on newly captured material

    I've read everything about jumpy video in this and other forums. So, I assume I either have a Quicktime 7 problem (I have FCE 2 running on an iMac G5 with OSX 10.3.9 Panther), or I have a problem with my external hard drive and/or fire wire. I have a

  • Itunes gets shut down by ie (dep program)

    I updated iTunes and now Internet Explorer is not allowing ActiveX controls and the Data Execution Prevention program is blocking iTunes from working and shutting it down

  • How to call a pcui application

    Hi, i try to call a pcui application from another web application. i tried to call the product app for displaying a specific product like this: http://server:8080/sap/bc/bsp/sap/crm_bsp_frame/entrypoint.do?appl=CRMM_PRD_SALES&blview=ZPROD_MAN&sap-sys