How to retrieve blob file

i am having a problem retrieving my blob file(PDF) to display on browser.
i have this code below:
$filename = $row['FILENAME'];
// Call the load() method to get the contents of the LOB
print $row['BINFILE']->load()."\n";
header('Content-type:application/pdf');
//header("Cache-Control: private",false); // required for certain browsers
header('Content-Disposition: attachment; filename="'.$filename.'"');
readfile($filename);
echo $row['BINFILE'];
this will display some characters when opened at mozilla. when opened on IE, this doesn't display pdf on the browser instead it will only allow to save the file.
hope anyone can give me some advice n some assistance on this.
thanks
Edited by: tamse on Jul 7, 2009 7:16 PM
Edited by: tamse on Jul 7, 2009 7:19 PM

I've got an example on my blog that might help, it's using a PNG. You can find it here:
http://blog.mclaughlinsoftware.com/php-programming/oracle-lob-processing/

Similar Messages

  • My music files etc were all located on my old laptop which was stolen. I have just plugged my iphone in to my new computer and it has deleted all my files. Has anybody got any ideas on how to retrieve the files?

    My music files etc were all located on my old laptop which was stolen. I have just plugged my iphone in to my new computer and it has deleted all my files. Has anybody got any ideas on how to retrieve the files?

    WINDOWS?
    Connect the iPod to your PC. If iTunes starts syncing (ie erasing) your music automatically, hit the X in the upper right hand corner of iTunes display, to the left of the search box, to stop it.
    In Control Panel, Portable Media Devices, double-click your iPod.
    In the Tools menu -> Options, in the View Tab, check "Show hidden files and folders."
    Navigate to the Music folder. On my 'pod, the full path is
    Portable Media Devices\NAME of IPOD (F:)\iPod_Control\Music
    Select all the music folders, and drag and drop them into a folder on your hard drive, or directly into iTunes.
    And you're done! The iPod music folder structure is strange and inexplicable, but once you move your files into iTunes you can set it to automatically organize your folder by artist and album to clean that up. (To do this, in iTunes Edit menu, choose Preferences and in the Advanced tab, check "Keep iTunes Music Folder organized."
    might be out of date worth a try

  • How to retrieve full flash solution from WSP if not than how to retrieve ascx files from Template folder in SharePoint 2013 ?

    How to retrieve ascx file from the Template folder in SharePoint2013
    My issue is, I have WSP only so I changed into zip and got my all web parts and also one dll file after that decrypted dll and got some C# code
    mixing with some system generated code but not ascx file that is for front-end part. So my question is how we can retrieve full flash solution if not, at least ascx files So if we were on SharePoint 2010 we could have got those file from __Template__
    folder but It’s on SharePoint 2013 and not able to get ascx.
    If we can do so, than will be easy to get the task to be done
    Suggestions would highly be appreciated. Thanks in Advance.
    Ashish

    Hi Amit,
    you can not move specific changes from Dev to production.
    but you can follow this process to make your workflow as it is as in Dev:
    Create a new workflow on the new list in Product.
    Create at least one step, one condition and one action in this workflow.
    1. In Dev server open your .xomal file as XML and copy the entire contents.
    2.In Production server Open your .xoml file as XML and Paste the entire contents
    3. repeat this operation for the xoml.rules file
    4.Double click the .xoml file for the new workflow to open the workflow in the Workflow Designer and click Check Workflow to verify no errors and then click Finish to ensure the workflow is saved.
    Whenever you need to make changes apply the same.
    Please Mark Answer and Vote me if it will to resolve your issue

  • How to retrieve pdf file saved in icloud drive from iphone

    how to retrieve pdf file saved in icloud drive from iphone or ipad

    Hi henawybek, 
    Welcome to Apple Support Communities. 
    Take a look at the article linked below, it provides answers to frequently asked questions about iCloud Drive and will help you solve your question.
    iCloud Drive FAQ
    You can access your files in iCloud Drive any of these ways:
    On your iPhone, iPad or iPod touch with iOS 8, you can use Apple apps like Pages, Numbers, and Keynote, or any apps that support iCloud Drive.
    I hope this helps.
    -Jason 

  • How to retrieve various file names from a filepath of application server

    Hi All,
    I am using a FILEPATH  of application server which can have multiple file names i want to retrieve data from all the existing files.
    i am using FM "GET_NAME_FILE" but it is applicable only for file name.
    so my question is how to fetch various file names of particular filepath.
    Thanks in advance.

    Hello Mayank,
    You can use the below FM and code
    PARAMETERS: p_file TYPE rlgrap-filename.
    ***AT Selection-Screen*******
    AT SELECTION-SCREEN ON  VALUE-REQUEST FOR p_file.
    ***Function  module for F4 help from Application  server
      CALL FUNCTION '/SAPDMC/LSM_F4_SERVER_FILE'
    * EXPORTING
    *   DIRECTORY              = ' '
    *   FILEMASK               = ' '
       IMPORTING
       serverfile             =  p_file
       EXCEPTIONS
       canceled_by_user       = 1
       OTHERS                 = 2
      IF sy-subrc = 0.
        MESSAGE 'Successful'  type 'I'.
      ENDIF.
    Regards,
    Mithun Shetty

  • How to retrieve all files in a given directory?

    Hi all,
    I am a newbie to Java. I have to retrieve all files in a given directory. The names of the files are not known to me. Only the name of the directory is known. How can I retrieve and read all those files?
    Gary

    Check out the list and listFiles method: http://java.sun.com/j2se/1.3/docs/api/java/io/File.html

  • Retrieving Blob files

    I have a SQL Server 7 database where files are stored as blob.
    Now I want to retrieve the files so i created a java program. I can retrieve the files, but when I open them (I saved them as txt) there unreadable.
    Then I found that in the text the type of document is specified. So I did a renaming. after this I'm able to open PDF files but word or excell files are still unreadable.
    does anybody have excperience with this?
    This is het part of the code used to extract the files.
    void getBinaryFileAttachment(String FileName,ResultSet rs) throws IOException, FileNotFoundException, SQLException
              //Array to hold array of file bytes
              byte[] fileBytes; //an array of bytes
              byte buf[] = rs.getBytes(1);
              System.out.println(buf);
              String ext = "";
              OutputStream targetFile;
              //Create and write the tempfile
              OutputStream tempFile=  new FileOutputStream("Temp.dat");
                tempFile.write(buf);
              tempFile.close();
              File f = new File("Temp.dat");               
              FileReader fr = new FileReader(f);
              BufferedReader br = new BufferedReader(fr);
              String meta = br.readLine();
              if(meta.indexOf(".pdf") != -1)
                   System.out.println("PDF File detected");
                   ext = ".pdf";
              else
              if(meta.indexOf("Word.Document.8") != -1)
                   System.out.println("Doc File detected");
                   ext = ".doc";
              else
                   ext = ".txt";
              fileBytes = rs.getBytes(1); //create a byte array from contents of field
              targetFile =  new FileOutputStream(FileName+ext); // define the output stream 
              targetFile.write(buf); //write the array of bytes to file
              targetFile.close(); //close the File stream
         }

    Documents saved through the OEL container type in Client Server are saved as serialised objects in the database - e.g. the thing the DB is not a binary copy of the document on disk, but a memory representation.
    WebUtil on the other hand - saves any file to the DB as a binary copy of the O/S file and likewise any file it pulls out will be an exact copy of what is in the DB.
    In the case of using WebUtil to pull out a document that was saved through an OLE container this will not work because the file on disk that WebUtil produces will not be the same as the source document.
    At some point we'll be writing a utility to de-serialise the OLE document that is Stored by OLE containers in a blob to restore them to file form on disk.
    You can of course do this manually by writing a Form (in 6i client server) which queries the blob into an OLE container and then uses OLE to call the Save method of the OLE server to pull the document onto disk.
    HTH

  • How to retrieve deleted files in Trash Empty Securely?

    I might have accidentally deleted a folder with many files in my Trash Bin > Empty Securely.
    I haven't used my Time Machine or Backed Up on iCloud?
    Is there any hope of retrieving the files?

    FWIW. In the future always have current backups before you erase a drive or start deleting a lot of files. In fact you should always maintain backups, and more than one. This would have prevented your frustration.

  • How to retrieve attachment file

    I am trying to create a program that will retrieve an Attachment that a candidate has uploaded into the eRecruitment system. Infotype HRP5134 has a pointer to the attachment, but where is the attachment stored? Is there a method, function module or BAPI that can retrieve the attachment?
    I want to retrieve the file and get the size of the file.

    Hi Subbu,
    It is not stored in Archive.  I got the solution.  I just want to share with u.  Actually i wanted the size of the documents.  I came out with the solution in 2 steps.
    1 step.  : I retreived all the attached document through function module HRRCF_MDL_CAND_ATT_RETRIEVE (suggested by u).
    2 step : i took the URL and used the function module SCMS_HTTP_GET_WITH_URL.  this gave me the size of the document in bytes. (thats what i wanted)
    Thank you very much for your efforts
    Sample code for your knowledge
    v_obj-plvar = '01'.
    v_obj-otype = 'NA'.
    v_obj-objid = '50000020'.
    CALL FUNCTION 'HRRCF_MDL_CAND_ATT_RETRIEVE'
    EXPORTING
       cand_hrobject       = v_obj
       langu               = sy-langu
      HTTPS               =
    IMPORTING
       records             = it_record
       messages            = it_error .
    LOOP AT it_record INTO wa_record.
      CALL FUNCTION 'SCMS_HTTP_GET_WITH_URL'
        EXPORTING
          url                         = wa_record-attachment_url
      BLANKSTOCRLF                = ' '
       IMPORTING
         length                      = length
         contenttype                 = contenttype
         mimetype                    = mimetype
         charset                     = charset
         version                     = version
        TABLES
          data                        = data1
       EXCEPTIONS
         bad_request                 = 1
         unauthorized                = 2
         not_found                   = 3
         conflict                    = 4
         internal_server_error       = 5
         error_http                  = 6
         error_url                   = 7
         error_signature             = 8
         OTHERS                      = 9
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDLOOP.

  • How to retrieve xml file from BLOB and display on browser with css/xslt

    Hi All,
    I am new to xml. I am storing my xml file into BLOB in database. Now in my jsp page I want to retrieve this xml file from BLOB and display in HTML/CSS/XSLT form...
    Pl. guide me.. any docs..?? Logic...??
    Thanks in Advance.
    Sandeep Oza

    Hello Sandeep!
    I'm not familiar with jsp but logic should be as follows:
    -in jsp page instantiate XML parser
    -load specified BLOB into parser
    Now you may traverse the XML tree or you might load XSL file and use transform method to transform XML according to XSL file.
    I have an example where I'm selecting XML straight from relational database and then transform it using XSL into appropriate HTML output, but it's written in PSP.
    You can try http://www.w3schools.com/default.asp for basics on XML, CSS, XSL. It's easy to follow with good examples.
    Regards!
    miki

  • ADF How to Download BLOB File from Database Column

    Hi,
    We have one blob Database Column in which we use for storing attachments(eg Image,.doc or.zip) . We are able to upload attachments.
    How can I build page which will access that particular record and will be able to download attachment in it.
    It should prompt to Save and then we can save it on Local machine.
    Thanks,
    Jit

    Sorry, I don't get your question.
    If you have a file name including the suffix like 'Test.file.doc' you can pass this file name as parameter to the method and get the MIME type back. I your sample it would be "application/msword"
    String mime = ContentTypes.get("Test.file.doc");
    public class ContentTypes
        public static String get(String fileName)
            String mime = null;
            String ext = fileName.toLowerCase();
            if (ext.endsWith(".pdf"))
                mime = "application/pdf";
            else if (ext.endsWith(".doc"))
                mime = "application/msword";
            else if (ext.endsWith(".xls"))
                mime = "application/msexcel";
            else if (ext.endsWith(".docx"))
                mime = "application/msword2007";
            else if (ext.endsWith(".xlsx"))
                mime = "application/msexcel2007";
            else if (ext.endsWith(".ppt"))
                mime = "application/vnd.ms-powerpoint";
            else if (ext.endsWith(".rar"))
                mime = "application/octet-stream";
            else if (ext.endsWith(".zip"))
                mime = "application/zip";
            else if (ext.endsWith(".jpg"))
                mime = "image/jpeg";
            else if (ext.endsWith(".jpeg"))
                mime = "image/jpeg";
            else if (ext.endsWith(".gif"))
                mime = "image/gif";
            else if (ext.endsWith(".png"))
                mime = "image/png";
            return mime;
    }Timo

  • How to retrieve cr2 files on iMac

    I have Uploaded canon cr2 files from iPad to iCloud via photo stream. Unfortunately my iPad was restored. how do I retrieve the original cr2 files on my iMac?

    Welcome to the Apple Community.
    If you added them to Photo Stream in the last 30 days. Turn on Photo Stream in iPhoto preferences and the images will be downloaded.

  • How to retrieve License file

    Hi Everyone,
    How do I retrieve my license file? The PAK was previously registered and we reformat the server and need a fresh installation but I don't know where to locate the license file.
    Thanks a lot.

    when you have previously registered the PAK an email was send to the mail address that was given in the form that you had to fill-in while doing the registration. That means you shoud have received an email with the license file attached. This file can be re-used on the fresh installation.
    If you do not have this file anymore, you can write a mail to licensingcisco.com with the PAK and your issue. If you even have the PO number (Product Order number) it should be easy...
    Installing the license can be done while installing LMS or later when you go to Common Services > Server > Admin > Licensing

  • How to retrieve damaged files

    I had recently deleted all songs synced with my iPod from my itunes library.
    Intending to add a song to the iPod, I connected it to my computer. The iPod started syncing and since there were no more songs in the itunes library except the one I intended to add, itunes was about to delete all the music files in my iPod. So, I disconnected the device. But about half of all the songs in my iPod could no longer be played. Disconnecting the device in the process of syncing seems to have been the cause of this.
    How do I undo this OR How do I make them playable again? I really don't want to lose those songs. Any suggestions?

    You can redownload most iTunes purchases by:        
    Downloading past purchases from the App Store, iBookstore, and iTunes Store         
    iPod recovery software to restore lost music files      

  • How to retrieve deleted files from sd card asap

    Hi All,
    I accidentally delete the folder in the sd card that was connected to my pc just now, this folder contains the software that runs the camera.
    Can you please advise as how i can retrieve the folder .Many thanks.
    Regards
    Anthony Chau
    This question was solved.
    View Solution.

    Hmmm.   Recycle bin emptied already? That is not a good sign.
    There is some freeware software that might work, but there is no guarantee that it will.
    Free undelete saved my bacon once in the past.
    ****Please click on Accept As Solution if a suggestion solves your problem. It helps others facing the same problem to find a solution easily****
    2015 Microsoft MVP - Windows Experience Consumer

Maybe you are looking for

  • How does Creative Cloud for teams work with staff who work in two locations ie in the office/home

    How does Creative Cloud from teams work with staff who work in two locations i.e. in the office and home?

  • Using in clause in oracle

    Hi, I am facing the following issue when trying to retrieve the data from a view.If i specify literals inside the in clause (example id's inside in clause) it's working fine,but when i try to use the subquery inside in clause to retrieve the id's fro

  • Erratic charging, No full charge.

    Possible warning to always use surge protection? While running my PB off an automotive inverter and then repeatedly trying to start a vehicle. (causing the inverter to go into low voltage alarm) A week or so ago also dropped it and bent the case, mak

  • Help understanding itunes and sync, itunes 10.5.0.142 does not import

    ok, first, im an old phart at a veterans home, so keep that in mind! Lol. Im not sure I understand Itunes. I thought it was supposed to sync, or keep on your ipod what you have in itunes library. In other words, if I have a play list and I delete a f

  • After effects CC Crashes at startup

    I get an error after splash screen whenever I try and start after effects. It was working a few months ago and I have uninstalled every app in the CC and ran the CC cleaner tool and reinstalled and still get the same message. Any help is appreciated!