Blob Upload dosent work.

First my english is very bad. Iam from germany and the problem i have cant fix in forums in germany.
so, please help me...
I have generate a pdf file that i must put in a oracle BLOB field.
Is Oracle 8
here is the code :
<?PHP
$lob_upload="a.pdf";
session_start();
$conn = OCILogon('secret','secret','secret');
$lob = OCINewDescriptor($conn, OCI_D_LOB);
$stmt = OCIParse($conn,"insert into \"tblArchiv\" (\"AR_Objekt\")
values(EMPTY_BLOB()) returning \"AR_Objekt\" into :the_blob");
OCIBindByName($stmt, ':the_blob', &$lob, -1, OCI_B_BLOB);
OCIExecute($stmt, OCI_DEFAULT);
if($lob->savefile($lob_upload)){
OCICommit($conn);
echo "Blob successfully uploaded\n";
}else{
echo "Couldn't upload Blob\n";
OCIFreeDesc($lob);
OCIFreeStatement($stmt);
OCILogoff($conn);
?>
This code generate a new entry. but the blob field ist empty.
Please help
Werner

Now i have found a sample code on Oracle side :
<?php
// Sample form to upload and insert data into an ORACLE CLOB column
// using PHP's Oracle 8 API.
// Based on http://www.php.net/manual/en/function.oci-new-descriptor.php
// modified to work on CLOBs and use register_globals = Off.
// Before running this script, execute these statements in SQL*Plus:
// drop table myclobtab;
// create table myclobtab (c1 number, c2 clob);
// Tested with PHP 4.3.3 against Oracle 9.2
if (!isset($_FILES['lob_upload'])) {
?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST" enctype="multipart/form-data">
Upload file: <input type="file" name="lob_upload">
<input type="submit" value="Upload">
</form>
<?php
else {
$myid = 1; // should really be a unique id e.g. a sequence number
$conn = OCILogon('secret', 'secret', 'secret');
// Delete any existing CLOB so the query at the bottom
// displays the new data
#$query = 'DELETE FROM MYCLOBTAB';
#$stmt = OCIParse ($conn, $query);
#OCIExecute($stmt, OCI_COMMIT_ON_SUCCESS);
#OCIFreeStatement($stmt);
// Insert the CLOB from PHP's temporary upload area
$lob = OCINewDescriptor($conn, OCI_D_LOB);
$stmt = OCIParse($conn, "INSERT INTO \"tblArchiv\" (\"AR_Objekt\") VALUES(EMPTY_BLOB()) RETURNING \"AR_Objekt\" INTO :C2");
OCIBindByName($stmt, ':C2', $lob, -1, OCI_B_BLOB);
OCIExecute($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'])) {
OCICommit($conn);
echo "CLOB successfully uploaded\n";
else {
echo "Could not upload CLOB\n";
$lob->free();
OCIFreeStatement($stmt);
OCILogoff($conn);
?>
This code runs good.
But. The PDF File is on the server right now.
So i change the code like this :
<?php
$myid = 1; // should really be a unique id e.g. a sequence number
$conn = OCILogon('secret', 'secret', 'secret');
// Delete any existing CLOB so the query at the bottom
// displays the new data
#$query = 'DELETE FROM MYCLOBTAB';
#$stmt = OCIParse ($conn, $query);
#OCIExecute($stmt, OCI_COMMIT_ON_SUCCESS);
#OCIFreeStatement($stmt);
// Insert the CLOB from PHP's temporary upload area
$lob = OCINewDescriptor($conn, OCI_D_LOB);
$stmt = OCIParse($conn, "INSERT INTO \"tblArchiv\" (\"AR_Objekt\") VALUES(EMPTY_BLOB()) RETURNING \"AR_Objekt\" INTO :C2");
OCIBindByName($stmt, ':C2', $lob, -1, OCI_B_BLOB);
OCIExecute($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.
          $form_data="a.pdf";
          $data = addslashes(fread(fopen($form_data, "r"), filesize($form_data)));
          if ($lob->save($data)) {
OCICommit($conn);
echo "CLOB successfully uploaded\n";
else {
echo "Could not upload CLOB\n";
$lob->free();
OCIFreeStatement($stmt);
OCILogoff($conn);
?>
This code have the same problem. It inserted an new entry but the blobfield is empty.
what is the mistake i made ?
again : my english is very bad sorry.
thanks
Werner

Similar Messages

  • My mothers mac the safari dosent work right the mail the mail wont open up certain emails saying the plugin is blocked etc

    my mothers mac the safari dosent work right the mail the mail wont open up certain emails saying the plugin is blocked etc

    Could be many things, we should start with this...
    "Try Disk Utility
    1. Insert the Mac OS X Install disc, then restart the computer while holding the C key.
    2. When your computer finishes starting up from the disc, choose Disk Utility from the Installer menu at top of the screen. (In Mac OS X 10.4 or later, you must select your language first.)
    *Important: Do not click Continue in the first screen of the Installer. If you do, you must restart from the disc again to access Disk Utility.*
    3. Click the First Aid tab.
    4. Select your Mac OS X volume.
    5. Click Repair Disk, (not Repair Permissions). Disk Utility checks and repairs the disk."
    http://docs.info.apple.com/article.html?artnum=106214
    Then try a Safe Boot, (holding Shift key down at bootup), run Disk Utility in Applications>Utilities, then highlight your drive, click on Repair Permissions, reboot when it completes.
    (Safe boot may stay on the gray radian for a long time, let it go, it's trying to repair the Hard Drive.)
    If perchance you can't find your install Disc, at least try it from the Safe Boot part onward.
    If 10.7.0 or later...
    Bootup holding CMD+r, or the Option/alt key to boot from the Restore partition & use Disk Utility from there to Repair the Disk, then Repair Permissions.
    Open Console in Utilities & see if there are any clues or repeating messages when trying to open Mail or Safari.

  • After upgrading to ios 5.1 on my iphone 3gs, the battery percentage dosent work well, it dosent move. how can i fix the problem?

    after upgrading to ios 5.1 on my iphone 3gs, the battery percentage dosent work well, it dosent move. how can i fix the problem?

    Have you tried doing turning the battery level display off and then General -> "Reset all settings"? You won't loose any data and that should do the trick.

  • I use iphone 4s on ios 7.0.4 but it dosent sync music with itunes 11.1.5.5 i tried everything but dosent work !!!

    i use iphone 4s on ios 7.0.4 but it dosent sync music with itunes 11.1.5.5 i tried everything but dosent work !!!
    any one can help ?
    now i phone is just 4 nothing

    Visit the local Apple store in the mall and they ran diagnostics on it. They told me the phone has no hardware problems.
    Still the issue is not resolved.
    Please help it has been more than 2 weeks that I have this problem and it seems no one is helping.

  • Why is my YouTube upload not working in CC 2014.0.1?

    I understand that the MOOV Atom issue was supposed to be fixed in the new version of PPro/AME released yesterday.
    New to the issue? The MOOV (or Movie) Atom is a piece of metadata that belongs at the very top of a streaming MP4 file. In the previous iteration of PPro/AME, the YouTube upload was a two-pass VBR process and it put the MOOV atom at the END of the file; a third-party software, MP4 FastStart, was required to move the MOOV. Then, YouTube uploads went without a hitch.
    "Without a hitch" means: YouTube acknowledges your upload and delivers the URL at which the video will appear when finished.
    There is NO "Video/Audio Quality" warning! That warning, indicating that the video you're uploading is not a streaming video, is a sign of trouble.
    I upload a 1 1/2 minute file and it appears to work perfectly i.e. no warning messages.
    However, when I upload the full 2 hours 15 minutes, it warns. The warning is not without teeth: my first upload of my large video was still not ingested and processed by YouTube after 4 hours. It would display...but this lovely work that I had uploaded at 1080p was showing in 360p.
    An additional issue is that the bit rate (8Mbps in the older version) has been bumped up to 16, making for huge upload files (literally double). Even after cutting the bit rate back in half to 8, it warns; I didn't complete the upload but suspect it still would not display properly.
    I'm now uploading the work separately by act (1 hour 15 and 1 hour for the two acts, respectively). If that doesn't work, I will need to uninstall and carefully re-install the software, not allowing the update to install (I'm told by TS that this is possible), and then get my work done. I'd obviously rather not have to do that. I'll actually do the uploads to YouTube this time and see if they process fully, whether or not I get the "Audio/Video Quality" message in the beginning.
    If anyone has any ideas (other than pointing out to the engineers via bug report that they seem to have messed up) I'm eager to hear.
    Jay

    Hi,
    Please check this.
    please have a look into this :
    CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
    filename =
    FILETYPE = 'ASC'** HAS_FIELD_SEPARATOR = ' '
    HEADER_LENGTH = 0
    READ_BY_LINE = 'X'
    DAT_MODE = ' '
    CODEPAGE = ' '
    IGNORE_CERR = ABAP_TRUE
    REPLACEMENT = '#'
    CHECK_BOM = ' '
    VIRUS_SCAN_PROFILE =
    NO_AUTH_CHECK = ' '
    IMPORTING
    FILELENGTH =
    HEADER =
    tables
    data_tab =
    EXCEPTIONS
    FILE_OPEN_ERROR = 1
    FILE_READ_ERROR = 2
    NO_BATCH = 3
    GUI_REFUSE_FILETRANSFER = 4
    INVALID_TYPE = 5
    NO_AUTHORITY = 6
    UNKNOWN_ERROR = 7
    BAD_DATA_FORMAT = 8
    HEADER_NOT_ALLOWED = 9
    SEPARATOR_NOT_ALLOWED = 10
    HEADER_TOO_LONG = 11
    UNKNOWN_DP_ERROR = 12
    ACCESS_DENIED = 13
    DP_OUT_OF_MEMORY = 14
    DISK_FULL = 15
    DP_TIMEOUT = 16
    OTHERS = 17
    IF sy-subrc 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    you have file type here , just give the type whether XLS or CSV format or whatever.

  • Upload functin works in Edit mode but not in View mode

    I am using the Oracle AS 10g PDK to integrate struts application into Portal. I found the upload function works fine in portlet edit mode, but it doesn't work in view mode (Go to the "The page cannot be found" and URL is "http://servername/portal/page"). Does anybody know the reason.

    Hi there
    Can you post a screen capture of what your Timeline looks like?
    Odds are your Click Box is pausing in a weird place.
    Cheers... Rick
    Helpful and Handy Links
    Begin learning Captivate 5 moments from now! $29.95
    Captivate Wish Form/Bug Reporting Form
    Adobe Certified Captivate Training
    SorcererStone Blog
    Captivate eBooks

  • Download Error - Contact customer support. Indesign wont load application have gone from the control panel. CS photoshop loads and wants a serial number - and my serial number dosent work?

    Download Error - Contact customer support. Indesign wont load application have gone from the control panel. CS photoshop loads and wants a serial number - and my serial number dosent work?

    Hello Bradley,
    sometimes the "opm.db file" is the culprit. In this case you should delete it.
    But as much as I regret it and as strange as it may seem I fear it's a challenge for Adobe's Creative Cloud Cleaner Tool.
    Sometimes - for whatever reasons - CC doesn't "want" to work. In this case you should CC completely delete and reinstall by help of Adobe Creative Cloud Cleaner Tool. (A try to uninstall by own resources is not enough!)
    I quote: ... helps resolve installation problems for Adobe Creative Cloud and Adobe Creative Suite (CS3-CS6) applications. The tool removes installation records for prerelease installations of Creative Cloud or Creative Suite applications. It does not affect existing installations of previous versions of Creative Cloud or Creative Suite applications.
    Please use: http://helpx.adobe.com/creative-suite/kb/cs5-cleaner-tool-installation-problems.html   and follow the prescribed sequence of operations
    If necessary and for further questions click through http://helpx.adobe.com/contact.html or http://helpx.adobe.com/de/contact.html and if "open" please use chat, I had the best experiences.
    Good luck!
    Hans-Günter

  • Mini Port on Mac Pro dosent work

    Hi there, Just get my new Mac Pro 12 core. I tried to install my 2 monitors that have already been tested on other computers. On is plugged into the DVI port and work just fine, the other one is plugged into one miniDV port and then into an HDMI cable into my monitor and dosent work. Ive done my software upgrades by the way. Is there something I should know about these mini Dv ports, other than they are really cheap and lots of people seems to complain about them?
    Thank you

    The new Mini DisplayPorts are not the same as the previous Mini DVI used on some older models. Be sure you have the correct adapter before proceeding.
    Presuming they are the correct ports, the cable must be completely inserted into the connector to make a reliable connection. All the metal part should disappear into the connector, leving only the plastic part showing on the outside.

  • For some reason my back button and refresh button dosent work,,,also my passwords are not saved in my craiglist windows

    i just had some update today didnt really read it it was with mozilla so i just installed, now my pages were the wrong sizes and the toolbar with the backpage and refresh dosent work also my passwords are not being saved on my craiglist page

    Don't worry about the time, as it took us a while to get it done. I learned a few things along the way, about Button Layer Set order, and what happens, once the Menu has been Imported.
    Most of it will not apply to your original questions, at least not as I read them, but might prove useful in time.
    Good luck, and happy reading...
    Hunt

  • Youtube uploading not working?

    I tried the one-click youtube upload option and it says that my name/password are incorrect. I definitely have IE cookies open and the name/password for the youtube account is correct. any idea what the problem is? Also, I notice the size for a .5 minute movie was over 00mb. Any suggestions on how to crop it down easily without too much quality loss? I was under the impression that youtube mode did this, but I can't get that to work.

    Ok,
    Got vado central youtube uploader to work.
    Here is the issue, at least when using?Internet Explorer v8:
    Go to menu bar,?tools, internet options, advanced tab, security section, the "check for server certificate revocation*" needs to be off instead of on.
    Close internet explorer and re-open so it takes effect. Then youtube uploaders works.
    Not sure why this is an issue using vado central youtube uploader and probably a bug as every other youtube uploader I have used with other software products has no trouble when "certificate revocation" is on

  • HT4993 Everytime i plug my phone into itunes it says it cant connect because the phone is locked well i restored my phone twice and set a new passcode the last time and it still wont work . I even deleted itunes and reinstalled it , it dosent work . HELP

    Everytime i plug my phone into itunes it says it cant connect because the phone is locked well i restored my phone twice and set a new passcode the last time and it still wont work . I even deleted itunes and reinstalled it , it dosent work . HELP PLZ !!

    I had the same issue. I tried everything unchecking / rechecking, formatting Iphone and restoring from backup etc etc.
    In the end it was a simple issue which might of might not help you.
    A number of months ago I relocated by Itunes folder to a NAS drive. It appears when I did the last I tunes update Itunes set the destination path of the Itunes media to the default location, the result was Itunes couldn't install music,apps, video until I set the correct destination path.
    The bit that confused me was it was transferring some media. This was of course the media I had downloaded since the last Itunes update which had gone to the default location.
    I hope that makes sense and is off some help.

  • Upload not working in Windows

    When using the
    FileReference in Flex 2
    final, I get an
    IOError followed by an HTTPError 403, when trying to upload
    using Windows. It's the same for Internet Explorer and FireFox.
    However, it works great on a mac, using both Safari and FireFox. I
    can't find any information regarding this problem. I am not sure if
    this is related to Flex 2 or the actual player, due to it's
    platform difference.
    Can anyone confirm that file upload is working for Flex 2
    Final, and Flash Player 9.0.16.

    Alright,
    So after spending a life time trying to debug the tcp flow
    from windows to the server, I was giving up.
    And then comes my colleague and finds this direct in google.
    We are running a pretty tight ship on our server, and we've
    installed mod_security, and it was blocking
    the stream... read more below.
    As found in some post somewhere:
    There is an issue with http error #406 that seems to be a
    result of mod_security and Apache. mod_security can scan post
    requests, and as this Flash post header for the FileReference
    object is missing a ":"-sign (this is what the server
    administrators says at the web hosting company I mostly work with)
    mod_security will block that request with a #406.
    I have access to two accounts at this web host
    (oderland.com), which both uses an application with a Flash image
    upload feature. On one of these accounts, which is hosted on a
    server without a post request scan, this feature works like a
    charm. But on the other one, which is hosted on another server
    where the post request scan is active, this feature gets the #406
    on every try.
    log2e said on Feb 26, 2006 at 5:51 AM :
    As for the #403 and #406 errors, try to create an .htaccess
    file in your root directory with:
    SecFilterEngine Off
    SecFilterScanPOST Off
    This solved the problem on my server.

  • Unable to upload PM Work Order Header Status

    Hi,
    I have made LSMW for tcode: IW31. I have a requirement to upload legacy data to SAP with their existing header status.
    For instance:
    I have a work order which got a header status complete and I want to upload this work order with its status. So, how can I upload different work orders with their different header status.
    Do let me know as soon as possible.
    Thanks for the contribution.
    Regards,
    Yahya

    Yes, you are right. Originally it should be the way you answered but requirement is to upload data with respect to their order status from legacy.
    In addition, is there any possiblity that I can create one complete LSMW for transaction IW31 OR IW32?
    This is asked because I am unable to upload data in Operatoins Tab
    Thanks.
    Regards,
    Yahya

  • HT1473 I am a songwriter and new at this.  Can I upload my work for sale on Itune and does Itune interact with the Performing Arts organization?

    I am a songwriter and want to upload my work to itune but I need a few question cleared up.
    1.     Does Itune interact with the Performing Arts organization such as BMI in order for artist to be paid or do i just set up a paypal account and pay artist myself?
    2.     What percentage of sales does itune take or is it a flat rate?
    3.     When i upload does itune give me an option to set price for my work.?

    TownSquareTheMusic wrote:
    I am a songwriter and want to upload my work to itune but I need a few question cleared up.
    1.     Does Itune interact with the Performing Arts organization such as BMI in order for artist to be paid or do i just set up a paypal account and pay artist myself?
    2.     What percentage of sales does itune take or is it a flat rate?
    3.     When i upload does itune give me an option to set price for my work.?
    Town Square,
    In addition to the iTunes Store, you may wish to check out some of the online stores that may be a bit more flexible for artists just starting to sell online:
    NoiseTrade
    BandCamp

  • The latest changes to the function to "Upload to FTP host" has rendered this useless - no point using a program like Muse if I can not easily and automatically upload the work to the webserver!

    The latest changes to the function to "Upload to FTP Host" has rendered this useless - no point using a program like Muse if I can not easily and automatically upload the work to the webserver!  I use BlueHost webhosting that has a primary domain and I have several domains with that account (as sub-domains or folders on this server) - with past versions of Muse when uploading pages it simply opened an alert window to tell me (what I already know) that the website I was uploading does not point to the primary domain BUT NOW Muse tries to create a new separate folder in the root directory of the primary domain - completely ignoring the directory path I am giving it - useless!  Why make these senseless changes to the program - and so often - very frustrating it is like amateur ware!.

    Hi Stephen,
    There are some issues with the upload to ftp via Muse, which the engineering team is aware of and those will be fixed in a future build of Muse. At this point the work around would be to export the html from Muse and then upload via some third party ftp client like filezilla.
    I will recommend that you keep an eye on our release notes page to get more updates on it - Release notes | Adobe Muse CC
    - Abhishek Maurya

Maybe you are looking for