PHP 5 Code to Upload and Retrieve an Image (aka BLOB) with Oracle

I keep being asked about BLOBs. For posterity, here is my example updated
to use the new PHP 5 OCI8 function names, and using bind variables for the BLOB id.
-- cj
<?php
// Sample form to upload and insert an image into an ORACLE BLOB
// column using PHP 5's OCI8 API. 
// Note: Uses the new PHP 5 names for OCI8 functions.
// Before running this script, execute these statements in SQL*Plus:
//   drop table btab;
//   create table btab (blobid number, blobdata blob);
// This example uploads an image file and inserts it into a BLOB
// column.  The image is retrieved back from the column and displayed.
// Make sure there is no whitespace before "<?php" else the wrong HTTP
// header will be sent and the image won't display properly.
// Make sure php.ini's value for upload_max_filesize is large enough
// for the largest lob to be uploaded.
// Tested with Zend Core for Oracle 1.3 (i.e. PHP 5.0.5) with Oracle 10.2
// Based on a sample originally found in
//     http://www.php.net/manual/en/function.ocinewdescriptor.php
$myblobid = 1;  // should really be a unique id e.g. a sequence number
define("ORA_CON_UN", "hr");             // username
define("ORA_CON_PW", "hr");             // password
define("ORA_CON_DB", "//localhost/XE"); // connection string
if (!isset($_FILES['lob_upload'])) {
?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST"
   enctype="multipart/form-data">
Image filename: <input type="file" name="lob_upload">
<input type="submit" value="Upload">
</form>
<?php
else {
  $conn = oci_connect(ORA_CON_UN, ORA_CON_PW, ORA_CON_DB);
  // Delete any existing BLOB so the query at the bottom
  // displays the new data
  $query = 'DELETE FROM BTAB WHERE BLOBID = :MYBLOBID';
  $stmt = oci_parse ($conn, $query);
  oci_bind_by_name($stmt, ':MYBLOBID', $myblobid);
  $e = oci_execute($stmt, OCI_COMMIT_ON_SUCCESS);
  if (!$e) {
    die;
  oci_free_statement($stmt);
  // Insert the BLOB from PHP's tempory upload area
  $lob = oci_new_descriptor($conn, OCI_D_LOB);
  $stmt = oci_parse($conn, 'INSERT INTO BTAB (BLOBID, BLOBDATA) '
         .'VALUES(:MYBLOBID, EMPTY_BLOB()) RETURNING BLOBDATA INTO :BLOBDATA');
  oci_bind_by_name($stmt, ':MYBLOBID', $myblobid);
  oci_bind_by_name($stmt, ':BLOBDATA', $lob, -1, OCI_B_BLOB);
  oci_execute($stmt, OCI_DEFAULT);
  // The function $lob->savefile(...) reads from the uploaded file.
  // If the data was already in a PHP variable $myv, the
  // $lob->save($myv) function could be used instead.
  if ($lob->savefile($_FILES['lob_upload']['tmp_name'])) {
    oci_commit($conn);
  else {
    echo "Couldn't upload Blob\n";
  $lob->free();
  oci_free_statement($stmt);
  // Now query the uploaded BLOB and display it
  $query = 'SELECT BLOBDATA FROM BTAB WHERE BLOBID = :MYBLOBID';
  $stmt = oci_parse ($conn, $query);
  oci_bind_by_name($stmt, ':MYBLOBID', $myblobid);
  oci_execute($stmt, OCI_DEFAULT);
  $arr = oci_fetch_assoc($stmt);
  $result = $arr['BLOBDATA']->load();
  // If any text (or whitespace!) is printed before this header is sent,
  // the text won't be displayed and the image won't display properly.
  // Comment out this line to see the text and debug such a problem.
  header("Content-type: image/JPEG");
  echo $result;
  oci_free_statement($stmt);
  oci_close($conn); // log off
?>

I am using oracle 10g [10.2.0.1.0] and PHP 4.3.9 with Apache.
I tried my best to change the old functions names for example(oci_fetch)
to the new (OCIFetch),i works every where, but i could not find the corresponded functions of (oci_fetch_assoc) that's why i can not see my BLOBS at all!
Can some help me please, to know where are corresponded functions of oracle 8 to oracle 10g?
Exactly here is my problem:
$query = 'SELECT BLOBDATA FROM BTAB WHERE BLOBID = :MYBLOBID';
$stmt = ociparse ($conn, $query);
OCIBindByName($stmt, ':MYBLOBID', $myblobid);
ociexecute($stmt, OCIDEFAULT);
$arr = oci_fetch_assoc($stmt);
// OCIFetchAssoc, OCIFetch, OCI_ASSOC ... nothing works-> Fatal error: Call to undefined function:
$result = $arr['BLOBDATA']->load();
What should i do?
Thanky very much.

Similar Messages

  • Uploading and retrieving the image in an ADF application

    I am using Jdeveloper 11.1.2.3.0
    In my image.jspx page i have a input file component and a 'show picture' button component
    My requirement is to upload the image to database and to show it when i click 'sow picture' button.
    need help in the whole process...
    1. Need syntax for query to save the img in the database. as far as i know we ve to use blob datatype, but i need full information.
    2. How to store img in database using input file component?
    3.How to show it by clicking the button ...
    Help plz

    http://tompeez.wordpress.com/2011/11/26/jdev11-1-2-1-0-handling-imagesfiles-in-adf-part-2/

  • Uploading,storing,retrieving,displaying images

    Hey,
    My issue relates to storing and retrieving images from a database. The image will be uploaded via the web and stored in a db, and later retrieved from the db and displayed on web page. The examples I have seen involve converting to an image to a byte stream then saving to the db as type blob. Then retrieving involves converting the byte stream to a file to display and then displayed on a web page. I have had problems with the examples, so I was wondering if you would be able to direct me to some clear and concise examples or material which would help to do this.
    thanks in advance for your assistance

    Could you please share the error/problem you are facing ?

  • Can u please send me a sample code to upload and download a file using java

    Hi,
    Please can u send me a sample code to upload a file and to download the same file from a remote server using a java servlets. The file should be read byte by byte.
    Message was edited by:
    user461713

    Hi, Thank u.
    Sorry, I forgot to attach a code. Here it is.
    Actually i need to upload a file to a remote server and download it from a server to my machine. I'm trying it using servlets and using tomcat5.0 as a servlet container. Here i'm sening a code used to upload a file. Let me know whether it works. Only few lines are here.
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.lang.Object;
    import java.util.*;
    import java.lang.String;
    import com.oreilly.servlet.MultipartRequest;
    public class FileUpload extends HttpServlet{
         public void doPost(HttpServletRequest req, HttpServletResponse res)throws
         ServletException, IOException{
         MultipartRequest multi=new MultipartRequest(req);     
         String file="file1";
         byte[] b=file.getBytes();
         InputStream in=null;
         BufferedInputStream bis=null;
         FileWriter fw=null;
    try{
         in=multi.getInputStream("file1");
    bis=new BufferedInputStream(in);
         File output=new File("/fileuploadtest");
         fw=new FileWriter(output);
              int i;
              i=bis.read();
              while (i != -1) {
    fw.write(i);
    i = bis.read();
         catch(IOException e){
              System.out.println("Exception=" +e);
    finally{
         try{
              if(in!=null)
              in.close();
              if(bis!=null)               
              bis.close();
              if(fw!=null)
              fw.close();
         catch(Exception e){
              System.out.println(e);
    This code is giving error as: cannot resolve symbol: class MultipartRequest
    Why is this happening?
    Pls let me know whether this code works or no and also i have written form.html.
    Can u pls tel me whether there are ways in which i can write a code to upload a file using servlets without using third party packages. Pls help.
    Also how should be the servlet mapping for this code.?
    Regards
    Message was edited by:
    user461713

  • Insert Image and Load Image by VC# with Oracle 9i Database.

    I need save and load a Image to Database Oracle 9i, i use BLOB Datatype and VC#2003, i write code bellow:
    Load image data.
    m_Img is a parameter byte[], and :
    this.openFile.ShowDialog(this);
    string strFn=this.openFile.FileName;
    this.pcPerson.Image=Image.FromFile(strFn);
    FileStream fls;
    fls=new FileStream(@strFn,FileMode.Open,FileAccess.Read);
    m_Img=new byte[fls.Length];
    fls.Read(m_Img,0,System.Convert.ToInt32(fls.Length));
    fls.Close();
    //Add Parameter
    CnnOracle myBase = new CnnOracle();
    string reqSQL = "SP_PERSON_UPDATE";
    try
    OracleConnection myConn = myBase.OpenConnection(myBase.cnxString);
    OracleCommand myCommand = new OracleCommand(reqSQL,myConn);
    myCommand.Parameters.Add(new System.Data.OracleClient.OracleParameter("Faxno", System.Data.OracleClient.OracleType.NVarChar, 20));
    myCommand.Parameters["Faxno"].Value = myPerson.faxno;
    myCommand.Parameters.Add(new System.Data.OracleClient.OracleParameter("Email", System.Data.OracleClient.OracleType.NVarChar, 20));
    myCommand.Parameters["Email"].Value = myPerson.email;
    myCommand.Parameters.Add(new System.Data.OracleClient.OracleParameter("Photo", System.Data.OracleClient.OracleType.Blob));
    myCommand.Parameters["Photo"].Value = m_Img;
    myCommand.CommandType = CommandType.StoredProcedure;
    myCommand.ExecuteNonQuery();
    myBase.CloseConnection(myConn);
    catch(Exception myErr)
    throw(new Exception(myErr.ToString() + reqSQL));
    That code above don't run and have a error: "ORA-01460: unimplemented or unreasonable conversion requested\n",
    but i clear these row:
    myCommand.Parameters.Add(new System.Data.OracleClient.OracleParameter("Photo", System.Data.OracleClient.OracleType.Blob));
    myCommand.Parameters["Photo"].Value = m_Img;
    and modified StoreProcedure: clear parameter Photo, it run good
    Why? Help me, Please.
    Thank you very much.

    Can you post your table structure?

  • Is it possible to save biometric template to SQL database and retrieve it later to match with current template?

    Hi,
    I want to save biometric template captured to SQLite database. I want to do this so that i can move around application without losing any data. Is it possible currently to save biometric template and match any fingerprint in future with currently saved templates
    in database. I am using C++ and SQLite driver. I don't know how to save Winbio Sample to sqlite or what data type exactly it is?

    Hi darky1234,
    Thanks for posting. It seems that biometric template issue is more related to developing with windows driver kit. I will move this issue to 
    Windows Hardware WDK and Driver Development forum for better support.
    Best regards,
    Shu
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Oracle Identity and Access Management Suite Plus Integration with Oracle ADF

    Hi All,
    Kindly advice if Oracle Identity and Access Management Suite Plus can be integrated with Oracle ADF based applications to manage the end-to-end lifecycle of user accounts specifically addressing to roles/priviledges and security.
    Request you to share links to documentation where I can study the steps to integrate both the frameworks.
    Looking forward to hear from you soon.
    Best Regards,
    Ankit Gupta 

    Hi Sébastien,
    I came across the below link for the required integrations -
    Oracle&amp;reg; Fusion Middleware Installation Guide for Oracle Identity and Access Management 11g Release 2 (11.1.2) - …
    Oracle&amp;reg; Fusion Middleware Enterprise Deployment Guide for Oracle Identity Management 11g Release 2 (11.1.2) - Co…
    Best Regards,
    Ankit Gupta

  • Upload and Retrieve Word documents

    Hai friends .. good Morning to all
    I am fresher i need your help ...
    Problem What i am Facing:
    I upload the file and stored in Mysql ..
    steps what i did to upload the file
    1) get the uploaded file and write it into the file InputStream
    2) using setBinaryStream(inputstramvalue);
    3) in mysql that file is stored Blob datatype
    Retrieve File
    1)i put getBlob("cloumn name " )
    getBlob("cloumn name " ) 2)ouput :
    com.mysql.jdbc.Blob@9ca1fbtell me how retrieve file display in jsp ..
    Please friends help me..

    <form action="/UploadAction" enctype="multipart/form-data">
            File : <input type="file" name="excelTemplate"/><br/>
            <input type="submit" name="name" value="upload"/>    
    </form>FileFiled.java:
    import java.io.InputStream;
    import java.net.URLConnection;
    public class FileField{
       private InputStream fileFieldInputStream = null;
       private byte fileFieldData[] = null;
       public void setFileFieldInputStream(InputStream fileFleidInputStream){
            this.fileFieldInputStream = fileFieldInputStream;
       public InputStream getFileFliedInputStream(){
            return this.fileFielddInputStream;  
       public void setFileFieldData(byte fileFieldData[]){
            this.fileFieldData = fileFieldData;
       public byte[] getFileFieldData(){
            return this.fileFieldData;
       public String getContentType(){
          String contentType = null;
           try{
              contentType = URLConnection.guessContentTypeFromStream(fileFieldInputStream);
              if(contentType == null)
                  contentType = "application/octet-stream";
           }catch(Exception exp){
          return  contentType;
    }FileUploadUtils.java:
    import java.io.File;
    import java.io.FileOutputStream;
    import java.util.ArrayList;
    import java.util.Date;
    import java.util.Iterator;
    import java.util.List;
    import javax.servlet.http.HttpServletRequest;
    import org.apache.commons.fileupload.FileItem;
    import org.apache.commons.fileupload.disk.DiskFileItemFactory;
    import org.apache.commons.fileupload.servlet.ServletFileUpload;
    import org.apache.commons.fileupload.servlet.PortletFileUpload;
    public class FileUploadUtils {
         private Map fileItemMap = null;
         private  Map nFileItemMap = null;
         private Object request = null;
         private ProgressListener pl = null;
         private static FileUploadUtils obj = null;
         public FileUploadUtils(Object request)throws Exception{
                 this.setRequest(request);                             
                 this.fileItemMap = new HashMap();
                 this.nFileItemMap = new HashMap();
                 this.init(this.getRequest());            
         public FileUploadUtils(Object request,ProgressListener pl)throws Exception{
                 this.setRequest(request);
                 this.setProgressListener(pl);
                 this.fileItemMap = new HashMap();
                 this.nFileItemMap = new HashMap(); 
                 this.init(this.getRequest());            
         protected void setRequest(Object request){
                 this.request = request;
         protected Object getRequest(){
              return this.request; 
         procted void setProgressListener(ProgressListener pl){
              this.pl = pl; 
         public static synchronized FileUploadUtils getInstance(Object request,ProgressListener pl)throws Exception{
                  if(obj == null)
                     obj = new  FileUploadUtils(request);
                  obj.setProgressListener(pl);
                  obj.init(obj.getRequest());  
                  return obj; 
         private void init(Object request)throws Exception{
                  Class requestClass = Class.forName("javax.servlet.HttpServletRequest");
                  if(request instanceof HttpServletRequest){
                     HttpServletRequest req = (HttpServletRequest) request;
                     if(ServletFileUpload.isMultipartContent(req))
                         this.portletMultiPartRequestInit();
                  }else if(request instanceof ActionRequest){
                       ActionRequest req = (ActionRequest)request;
                       if(PortletFileUpload.isMultipartContent(req))
                           this.servletMultiPartRequestInit();
         private void servletMultiPartRequestInit() throws Exception{
             DiskFileUpload dfu  = null;
             List fileItems  = null;   
             try{
                   // an object which deals with parsing the Multipart request made to the Controller
                   ServletFileUpload servletFileUpload = new ServletFileUpload(new DiskFileItemFactory());               
                   if(pl != null)
                     servletFileUpload.setProgressListener(pl);
                   // setting Max file Size
                   servletFileUpload.setSizeMax(1000000);
                   // parsing the multipart request made 
                   fileItems = servletFileUpload.parseRequest(this.request);
                    // checking whether the content supplied is multipart content or not & checking whether we have got any elements in the generated list or not    
                   if(dfu.isMultipartContent && fileItems != null){
                            Iterator iter =  fileItems.iterator();
                           while (iter.hasNext()) {
                                FileItem item = (FileItem) iter.next();           
                                  String fieldName = item.getFieldName(); 
                                        // checking whether the field is a Non-File filed like textbox ,combo box & etc or not                                       
                                        if (!item.isFormField()){
                                            String fieldValue = item.getString();
                                            this.nFileItemMap.put(fieldName, fieldValue);  
                                        }else{
                                           FileField ff = new FileField();
                                           ff.setFileFieldInputStream(item.getInputStream());
                                           ff.setFileFieldData(item.get()); 
                                           this.fileItemMap.put(fieldName,ff);    
                    }catch(Exception exp){
                         exp.printStackTrace();
                         System.err.println(exp.getMessage());
                         throw new Exception(exp.getCause());
                    } finally{
                       fileItems = null;
                       dfu = null; 
             private void portletMultiPartRequestInit() throws Exception{
                DiskFileUpload dfu  = null;
                List fileItems  = null;   
                try{
                   // an object which deals with parsing the Multipart request made to the Controller
                   PortletFileUpload portletFileUpload = new ServletFileUpload(new DiskFileItemFactory());               
                   if(pl != null)
                     portletFileUpload.setProgressListener(pl);
                   // setting Max file Size
                   portletFileUpload.setSizeMax(1000000);
                   // parsing the multipart request made 
                   fileItems = portletFileUpload.parseRequest(this.request);
                   // checking whether the content supplied is multipart content or not & checking whether we have got any elements in the generated list or not    
                   if(dfu.isMultipartContent && fileItems != null){
                            Iterator iter =  fileItems.iterator();
                           while (iter.hasNext()) {
                                FileItem item = (FileItem) iter.next();           
                                  String fieldName = item.getFieldName(); 
                                        // checking whether the field is a Non-File filed like textbox ,combo box & etc or not                                       
                                        if (!item.isFormField()){                                    
                                            String fieldValue = item.getString();
                                            this.nFileItemMap.put(fieldName, fieldValue);  
                                        }else{
                                           FileField ff = new FileField();
                                           ff.setFileFieldInputStream(item.getInputStream());
                                           ff.setFileFieldData(item.get());   
                                           this.fileItemMap.put(fieldName,item);    
                    }catch(Exception exp){
                         exp.printStackTrace();
                         System.err.println(exp.getMessage());
                         throw new Exception(exp.getCause());
                    } finally{
                       fileItems = null;
                       dfu = null; 
             /** returns a Map of File Field Items*/
             public  Map  getFileFieldMap(){
                    return this.getFileFiledsMap;
             /** return a List of Non-File fields*/  
             public Map getNonFileFieldMap(){
                   return this.nFileItemMap;
    }NOTE: we are ought to include commons-fileupload & commons-io library util libraries for running the above util class.
    UploadAction:
    public void uploadAction(HttpServletRequest request,HttpServletResponse response)throws Exception{
         FileUploadUtils fuu = new FileUploadUtils(request);
         Map fileItems = fuu.getFileFieldMap();
         Map nFileItems = fuu.getNonFileFieldMap();
         FileField ff = null;
         if(fileItems.get("excelTemplate") != null){
                    ff = (FileField)fileItems.get("excelTemplate");
                    if(ff.getContentType().equals("application/vnd.ms-excel")){
                        FileUploadDAO fud = FileUploadDAO.getCurrentInstance();
                        fud.addFile(ff.getFileFliedInputStream());   
                    }else{
                           throw new Exception("Invalid Data Uploaded");
         }else{
              throw new Exception("An Upload Invalid Request");
    }FileUploadDAO.java:
    import java.sql.Connection;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import javax.sql.SerialBlob;
    import java.sql.Blob;
    import com.myapp.dao.conn.DbConnectionUtils;
    import com.myapp.service.BModelService;
    public class FileUploadDAO{
        private static FileUploadDAO fup;
        protected FileUploadDAO(){}
        public static synchronized FileUploadDAO getCurrentInstance(){
              if(fup == null)
                 fup = new FileUploadDAO();
              return fup;
       /*Methods to Insert the Uploaded file to the Database*/
       public boolean addFile(InputStream fis,int length){
           Connection con = null;
           PreparedStatement pstmt = null;
           ResultSet rs = null;
           boolean flag = false;
           try{
               String sqlQuery = "insert into file_table (fileBlob) values (?)";
               con = DbConnectionUtils.getConnection();
               pstmt = con.prepareStatement(sqlQuery);
               pstmt.setBinaryStream(1,fis,length);
               int i = pstmt.executeUpdate();
               if(i > 0)
                 flag = true;
           }catch(Exception exp){
                exp.printStackTrace();     
           }finally{
               try {      
              if(pstmt != null)                   
                 pstmt.close();                
              if(con != null)
                       con.close();                                
           }catch(Exception exp){                   
           }finally {
              pstmt = null;
                 con = null;
           return flag;
       public boolean addFile(InputStream fis){
           Connection con = null;
           PreparedStatement pstmt = null;
           ResultSet rs = null;
           boolean flag = false;
           try{
               String sqlQuery = "insert into file_table (fileBlob) values (?)";
               con = DbConnectionUtils.getConnection();
               pstmt = con.prepareStatement(sqlQuery);
               pstmt.setBinaryStream(1,fis);
               int i = pstmt.executeUpdate();
               if(i > 0)
                 flag = true;
           }catch(Exception exp){
                exp.printStackTrace();     
           }finally{
               try {      
              if(pstmt != null)                   
                 pstmt.close();                
              if(con != null)
                       con.close();                                
           }catch(Exception exp){                   
           }finally {
              pstmt = null;
                 con = null;
           return flag;
       public Blob getFileData(String fileId){
           Connection con = null;
           PreparedStatement pstmt = null;
           ResultSet rs = null;
           SerialBlob sb = null;
           try{
               String sqlQuery = "select fileBlob from file_table where fileId = ?";
               con = DbConnectionUtils.getConnection();
               pstmt = con.prepareStatement(sqlQuery);
               pstmt.setString(1,fileId);
               rs = pstmt.executeQuery();
               if(rs.next()){
                  Object obj = rs.getObject(1);
                   if(obj instanceof Blob)
                      sb = new SerialBlob((Blob)obj);
           }catch(Exception exp){
                exp.printStackTrace();     
           }finally{
               try {      
              if(pstmt != null)                   
                 pstmt.close();                
              if(con != null)
                       con.close();                                
           }catch(Exception exp){                   
           }finally {
              pstmt = null;
                 con = null;
           return sb;
    }Display Action:
    public void displayAction(HttpServletRequest request,HttpServletResponse response)throws Exception{
            String fileId = request.getParameter("fid");
            if(fileId == null)
               throw new Exception("Invalid Action Requested");
            FileUploadDAO fud = FileUploadDAO.getCurrentInstance();
            Blob blob = fud.getFileData(fud);
            if(blob == null)
               throw new Exception("No Data Found");
             String mimeType = URLConnection.guessContentTypeFromStream(blob.getBinaryStream());
             if(mimeType == null)
                mimeType = "application/octet-stream";
             response.setContentType(contentType);
             response.setContentLength(blob.length());
              BufferedInputStream input = null;
              BufferedOutputStream output = null; 
              int contentLength = blob.length();
              try{
                     input = new BufferedInputStream(blob.getBinaryStream(),768);
                     output = new BufferedOutputStream(response.getOutputStream(),768);
                    while ( contentLength-- > 0 ) {
                                     output.write(input.read());
                     output.flush();
              }catch(Exception exp){
              }finally{
                  if(input != null){
                       try{input.close();}catch(Exception exp){}
                  if(output != null){
                       try{output.close();}catch(Exception exp){}
    }now in order display it on to a JSP here is how you can render the content.
    <iframe src="displayActionUrlPattern?fid=2345ab"/>Hope the discussed example above might be of some help :)
    REGADS,
    RaHuL

  • To Upload and Download an image

    Hi Experts.
    I have a requirement wherein i have to uplaod an image ( for eg: a screenshot of an error ).
    Afer uploading i want  to show the preview of that image and save the same in the database , so that later on  i want to also download that image and show it next to the Text Area.
    Any inputs would be helpful.
    Thank You ,
    Radhika.

    Hello Radhika,
    You need to create transparent table following fields e.g.
    Field Name                Data Type
    DATA          RAWSTRING
    NAME          STRING
    TYPE          STRING
    Create the context for above mentioned fields and bind the properties of data, filename & mimetype with File Upload & Download UI elements
    In WDA use File Upload & File Download UI Elements & Save button for saving the data file.
    On Save action update the data base table.
    Thanks
    Vishal

  • How to save and retrieve an image in JSP/Java and MS SQL/server 2000?

    Hi All,
    I am uploading an image from the JSP page and want to store it in MS SQL server. I have made a column by the name "COMPANY_LOGO" with data type as image MS SQL/server 2000. How do I save the full image in the table and how do I display the thumb nail image on the JSP page???
    Regards,
    Raj

    BEFORE YOU POST A TOPIC HERE: Please be sure your topic is related to features or functionality of this site. This forum is not for general technology questions. Not sure which forum to use? Try searching for your topic in the "Search Forums" element on the left panel.
    Post your question in
    http://forum.java.sun.com/forum.jspa?forumID=45
    or
    http://forum.java.sun.com/forum.jspa?forumID=48
    Do not reply here

  • Uninstalling and retrieving original images?

    When I first installed Aperture I set it to import all my original images in their relevant folders into the one main Aperture library stored in my pictures folder. Now that I want to uninstall Aperture I'm kinda lost as to how I retrieve all those original images and hopefully still in their named folders?
    Thanks in advance for any help.

    You want to export the Masters:
    File-> Export -> Masters
    Regards
    TD

  • How to save, combine and retrieve the images on hard drive using IMAQ in labview

    Hi,
    I am using NI-1426 frame grabber to capture images of 800x1 resolution with 270 bands. Actually, I want to capture images from camera and saving into the hard drive continuously so that my buffer does not run out of memory.  After capturing say 100 images of same resolution (800x1), I want to combine all images into ENVI format and then again save on hard-drive. Please guide me how can I do that?
    Thanks
    Sidd 

    Hi Jeff,
    Let me explain it in little detail.
    I am using PCI NI-1426 frame grabber to capture the images at particular frame rate. Ni-1426 has 2 ports i.e. 26 pin camera and 15 pin triggering port. I am sending the pulse per second (pps) signal from gps to the triggering port. I want to check for the pps signal through the frame grabber 15 pin port. Please tell me how can I listen to a trigger through a frame grabber in labview? As I have connected pps signal on pin1 in 15 pin port, I want to read that pin. or how can I read a particular  pin data in labview? I have already checked that I am getting pps signal through oscilloscope.
    Thanks
    Regards,
    Sidd 

  • How to store and retrieve .jpeg images from oracle database.

    I am using JSP. Can anybody tell me the process of doing it.

    I believe Oracle reccommends to use BLOBs for storing large binary data.
    Check on DBMS_LOB package on Oracle documentation: it has all the API's you
    need.

  • How to retrieve image in BLOB in oracle database using JSP?

    do any one the method to view image in homepage using jsp from BLOB field in oracle database ?
    thx

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Bon BOn:
    do any one the method to view image in homepage using jsp from BLOB field in oracle database ?
    thx<HR></BLOCKQUOTE>
    I am using a servlet that retrieves the BLOB from the database, sets the MIME type and puts it in a stream. The code is :
    package TestQueryITM;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.util.*;
    import java.net.*;
    import java.sql.*;
    import oracle.sql.*;
    import oracle.jdbc.driver.OracleDriver;
    import oracle.jdbc.driver.*;
    public class MIMEServlet extends HttpServlet {
    DbConnect myDbBean = new DbConnect();
    int Id=6;
    String MIME ="plain/text";
    public void init(ServletConfig config) throws ServletException
    super.init(config);
    public void doGet(HttpServletRequest req,HttpServletResponse res)
    throws ServletException, IOException
    try
    String content_type = new String();
    String filename = new String();
    // Load the Oracle JDBC driver:
    Class.forName("oracle.jdbc.driver.OracleDriver");
    // Connect to the database:
    Connection conn = DriverManager.getConnection
    ("jdbc:oracle:thin:@ORAVISION:1521:DEV","[username]", "[password]");
    // It's faster when auto commit is off:
    conn.setAutoCommit (false);
    // Create a Statement:
    Statement stmt = conn.createStatement ();
    try
    BLOB lob_loc = null;
    java.io.InputStream in = null;
    int pos = 0;
    int length = 0;
    OracleResultSet rset = (OracleResultSet) stmt.executeQuery (
    "SELECT text FROM test WHERE ID = "+Id);
    if (rset.next())
    lob_loc = ((OracleResultSet)rset).getBLOB(1);
    MIME=rset.getString(2);
    // File binaryFile = new File("C:/aantekeningen.doc");
    // FileInputStream in = new FileInputStream(binaryFile);
    in = lob_loc.getBinaryStream();
    // This loop fills the buf iteratively, retrieving data // from the InputStream:
    res.setContentType (application/pdf);
    res.setHeader ("Content-Disposition","attachement;filename=test.doc");
    ServletOutputStream op = res.getOutputStream ();
    byte[] buffer = new byte[32000];
    while ((in != null) && ((length = in.read(buffer)) != -1))
    // the data has already been read into buf
    System.out.println("Bytes read in: " +
    Integer.toString(length));
    op.write(buffer,0,length);
    op.flush();
    op.close ();
    in.close();
    stmt.close();
    conn.commit();
    conn.close();
    }catch (SQLException e)
    e.printStackTrace();
    }catch(Exception e)
    System.out.println("<BR>");
    e.printStackTrace();
    System.out.println("<BR>");
    public String getServletInfo() {
    return "TestQueryITM.MIMEServlet Information";
    null

  • Lightroom 4 - Select, Rate and Prioritize Your Images | Getting Started with Adobe Photoshop Lightroom 4 | Adobe TV

    Find out which method of tagging images works best for the photography you do in order to simplify the creation of collections of images.
    http://adobe.ly/xGuxSt

    Julieanne, your tutorials are hands down the best and the most professional I have ever come across. I really feel like I am back at school listening to my favorite teacher.
    Thanks!

Maybe you are looking for

  • How do i install printer software for wireless connection for a notebook?

    Product name: Photosmart 6510 What to do when my notebook laptop does not have a disk drive but has wireless internet. How can I install the printer software on the CD? Kind regards

  • Transporting OSS Notes from Dev to QA returns error

    Hi, I have implemented all these notes in Dev: 1448397 1453128 1462423 1465685 1472991 1478699 1486208 1490183 1495277 1512748 1540869 1550964 1558355 1564254 1568563 1575454 I don't get any error during implementation in Dev. When transport to QA, i

  • Using iPod nano in cold wheather

    I go for a run everyday with my iPod nano. It is covered with a nano tube and invisible shield to protect it and to cover up the 2 scratches I made. So I am very pleased with it. But now that winter is coming up, that means another harsh Canadian win

  • OpenCL include path with spaces

    Hi! I tried passing additional include paths to the clBuildProgram(...) function using "-I dir" as given in the specification. This works perfect as long as the directory name given does not contain any spaces. However on some platforms you cannot av

  • Service Master Enhancement

    Hi all, I need to enhance the service master creation transaction (AC01) to accommodate the following: 1. Hide the service number field to avoid user input (can't find this option in configuration) 2. Generate service number based on the selected Sta