Inserting a filename into BLOB

There is a lot of talk about inserting a file into BLOB or
just the file path and storing the file locally. I've decided to
store the file on the server but what I don't know is how to
capture that path and file name so I can insert it into the MySQL
database and later retrieve it when the display page is loaded.
Also, what is the download side of this? When the page is
called is there a 'best way' to serve up the file to the user?
Any sample code for this type of thing would really help me
get past this sticking point.
Thank you in advance.
I'm using a CF8/MySQL 5.x setup. Attached is my upload
code...

Bob,
Thanks for the code, but won't that actually store the
document in the database rather than just storing the file path? I
guess I was thinking it would be smarter to store the path in the
DB rather than the actual file itself. I know this is an invitation
to a heated discussion as I've found many examples of it here in
the forums...
Maybe I'm just misreading the code. And, yes, the intent is
to store PDF files for the client's app.
The intent is that when a user visits page 'x' they see a
short description of a lesson then click on a link to download the
pdf resource for that particular lesson. Maybe there is a better
way to do this, I don't know. I'm relatively new at this type of
situation.
Thank you for your quick reply!

Similar Messages

  • Reading BFile datatype value to insert corresponding value into blob

    Hi,
    I have oracle 10.2.0 database.
    I have this table with 3 columns of datatypes
    TableA(id, Blob, BFile)
    now i have pdf files stored in a directory for every id which ranges from 1 till 100.
    for example for id=10, the pdf file name is cr10.pdf
    except that for some id there is no correpsonding pdf's.
    and i have a written a query where for a particular id, i link the corresponding pdf into the BFile. now is there a way where i can view the value of the bfile locator and find whether the bfile is null or not(i mean whether there is a pdf or not existing for that particular id)
    what i need to do is, based on the bfile value i will insert the pdf into the blob column.
    so based on the bfile value(ie whethe rthe pdf exisit or not) i will open the pdf and read the contents into the blob column.
    and somehow i have figure out that a pdf is not exisiting based on the bfile value and then insert a null into the blob column instead of getting an error by trying to read a pdf which doesn't exist.
    Can someone help me, how to find out existance of a file based on bfile value and insert value into blob.
    I want this is script to be automated instead of checking manually a file exists or not.
    Thanks,
    Philip.

    Hi,
    I have oracle 10.2.0 database.
    I have this table with 3 columns of datatypes
    TableA(id, Blob, BFile)
    now i have pdf files stored in a directory for every id which ranges from 1 till 100.
    for example for id=10, the pdf file name is cr10.pdf
    except that for some id there is no correpsonding pdf's.
    and i have a written a query where for a particular id, i link the corresponding pdf into the BFile. now is there a way where i can view the value of the bfile locator and find whether the bfile is null or not(i mean whether there is a pdf or not existing for that particular id)
    what i need to do is, based on the bfile value i will insert the pdf into the blob column.
    so based on the bfile value(ie whethe rthe pdf exisit or not) i will open the pdf and read the contents into the blob column.
    and somehow i have figure out that a pdf is not exisiting based on the bfile value and then insert a null into the blob column instead of getting an error by trying to read a pdf which doesn't exist.
    Can someone help me, how to find out existance of a file based on bfile value and insert value into blob.
    I want this is script to be automated instead of checking manually a file exists or not.
    Thanks,
    Philip.

  • Cannot insert value with : into BLOB field

    I am using Oracle 10g Express Edition.
    Attempting to run this insert from the SQL Commands page:
    INSERT INTO table1 (col1, col2)
    VALUES ('one', '\"2.001:2372.002:002.005:Y2.018:G')
    Table1 info:
    col1 = VARCHAR2(25)
    col2 = BLOB
    After I click Run an Enter Tab Variables appears?
    Is it possible to insert the value straight into col2 without entering bind variables?

    wrong forum

  • No longer able to insert filename into a document in the new pages

    Does anyone know if the ability to insert the filename into the document has been eliminated or if we just have to get to it another way? Used to be able to go to INSERT>FILENAME but that seems to have disappeared.
    Thanks
    AJ

    It does cause problems in a number of circumstances.
    In this forum alone, there are several threads with many users who used Setup Assistant or Migration Assistant to transfer their stuff, ended up with lots of duplicate apps because of it, and had great difficulty finding and deleting the duplicates.
    There have also been folks whose apps did't get updated, and Adobe apps that wouldn't run at all.
    Again, it depends on the apps and circumstances.

  • INSERT into BLOB

    I want to insert image/bFile into blob data.
    I need the insert statement on that data.
    Thanx.. Ratan

    Hi
    Check the below Documentation:
    http://download-west.oracle.com/docs/cd/A97630_01/appdev.920/a96591/adl07mds.htm#119691
    Regards
    RK

  • Inserting String data to BLOB column

    Hi All
    I want to insert String data into BLOB column using DBAdapter - through database procedure.
    anybody can help?
    Regards
    Albin Issac

    I have used utl_raw.cast_to_raw('this is only a test')).But for bigger string I get the error as "string literal too long" do we have any similar function for longer string.
    Thanks,
    -R

  • Problem inserting a gif into a blob field in a table with sqldev / forms6i

    Problem solved - For those that might be interested, the errors don't make much sense - the problem was with the gif. Seems that these 28 gifs plus the new scans were saved from the scanner with
    GIF - LZW, Transparent color: 255
    Converting them to Black and white allowed them to be loaded.
    If anyone understands why, I'd like to know
    glenn
    I was previously having a problem deleting a row with a blob and it was suggested that I create the table using rowdependencies - which I did as follows.
    CREATE TABLE "MDD"."MDD_FIGURE2"
    (     "FG_FIGURENAME" VARCHAR2(18 BYTE),
         "FG_FIGURE" BLOB,
         CONSTRAINT "FG_FIGURENAME_NN" CHECK ("FG_FIGURENAME" IS NOT NULL) ENABLE
    ) ROWDEPENDENCIES;
    Then I copied my data from my previous table with the following - and everything came across
    INSERT INTO MDD_FIGURE2 (fg_figurename, fg_figure)
    SELECT FIG_FIGNAME, FIG_FIGURE FROM MDD_FIGURE;
    mdd_figure2 was then renamed to mdd_figure
    The table, Mdd_Figure, already contains some 2000+ .gifs that were successfully loaded with Forms 6i (yes, I know it is old, but I am stuck with having to use it). All the .gifs I am loading are from scans and all are less than 64k. However, 28 .gifs would not load. When I insert the .gif into the field and committed the form, the status message tells me a record was written but when I check it, the blob is empty.
    So, when I try to insert one of these problem .gifs in SqlDeveloper, I open the new mdd_figure table, select the blob field, open the edit dialog, set it to figure, select the .gif that I want to load and then save it. The blob field changes from NULL to BLOB, but it is empty. When I try to commit, I get the following error from SqlDev.
    UPDATE "MDD"."MDD_FIGURE" SET WHERE ROWID = 'AAAOeWAAEAAABAlAAz' AND ORA_ROWSCN = '358136842'
    One error saving changes to table "MDD"."MDD_FIGURE":
    Row 14: ORA-01410: invalid ROWID
    I use rollback to restore the record to it's previous state.
    If I load one of the successfully loaded .gifs into the same field, it loads perfectly as follows.
    UPDATE "MDD"."MDD_FIGURE" SET WHERE ROWID = 'AAAOeWAAEAAABAoAAp' AND ORA_ROWSCN = '358136522'
    Commit Successful
    It appears the 28 gifs have a problem. I've re-scanned them, with the same results. They are just small scanned line map images from our earlier publications. They view properly in several different graphics programs and I can't find anything wrong with them.
    I notice that the ROWID's are different while the ORA_ROWSCN's are the same - but what is the significance of that?
    Any suggestions as to what is happening and what I can do about it?
    Thanks for any help you can give me.
    glenn
    (Database is 10R2 and sqldev is the most recent one)
    Edited by: gconley on Sep 25, 2008 9:51 PM

    solved it myself - problem was with the gif

  • How can I insert a image into a BLOB column in a table?

    I am using forms6i against a 10gR2 database and I have one table with a BLOB column and I try to insert a image into this column. I get ORA-01461 error.
    The curious case is that in another table with a BLOB column it works very fine.
    What happens with the first table? How can I avoid the error?
    Thanks in advance.

    Hi hyue,
    Thanks for visiting Apple Support Communities.
    If you would like to add an image to a project in iMovie for iOS, see this article for helpful steps:
    iMovie for iOS (iPad): Add photos to a project
    http://support.apple.com/kb/PH3171
    All the best,
    Jeremy

  • Insert Filename into IPTC Title metadata

    Good Morning,
    I am wondering if there is a way to insert the filename of an image into the IPTC title metada.
    Below is an example of our file name system.
    (ex. YYMMDD-M-TI822-001)
    The only part that changes is the 3 digit number at the end.
    How would I go about writing a script to have Bridge automatically do it or is there one already writen that I can download and use?
    Thank you for your help.

    Change:
    md.Title = thumb.name;
    To:
    md.Title = decodeURI(thumb.name).replace(/\.[^\.]+$/, '');

  • Conserving filename with upload via portal form into blob type

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

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

  • Inserting Image into BLOB field from URL

    Is it possible to insert an image into a BLOB field from a URL? I don't have access to the filesystem on the server and I have a page that uses PL/PDF to generate dynamic PDF files from data I pull from the database. I would like to include my companies official header with logo on the top of the PDFs I generate and need to somehow get the image which I currently have uploaded to the images section in Application Express and can access from the "Shared Components => Images" section of the Application Builder. I just want to be able to either query whatever table holds those images or copy the image I need to a blob field in one of my tables so I can use it in my PDF document.
    The other alternative (which is what I first mentioned above) would be to try and perform an insert into the BLOB field in my table but the location of the image file would be like "http://www.myportal.com:7777/pls/htmldb/wwv_flow_file_mgr.get_file?p_security_group_id=1234567&p_flow_id=111&p_fname=myimage.jpg".
    Is this possible? If not, what can I do?
    Thanks in advance.

    The reason why I am asking this question in this forum is two-fold:
    1. I am using Application Express (AE).
    2. Since I am using AE all images that I upload to my workspace are stored in a table in a database and not as an actual file in a directory structure like in Windows etc. This being the case, I can't ever reference any of the files that I upload to my workspace in order to insert them into my BLOB field unless I know their physical location on disk (which of course does not exist b/c they are stored in the AE database somewhere). If I knew AE's database and table structure I could do a "select into ..." from whatever table stores my uploaded images and save those images to my own custom table in my BLOB field.

  • Inserting current pathname and filename into Pages documents?????

    Pages help explicitly says you can put "filenames" and "pathnames" into formatted text fields just as you can put in page numbers and the date. It does NOT tell you how to do this!!! What do I type so that my current pathname appears in pages? Or the current filename of my document?? I am trying to create a template so that filename, pathname, date, and number of pages always appears in the header.

    Well, it is possible to automatically insert the document's filename into the header as I routinely do it in (dare I say) Microsoft Word and Microsoft Excel. I write many documents long and short. For each of them I start with the same template, one that includes the filename and the date "last saved" in the header.
    Those who have an ironclad hierarchy where every file is unambiguously filed into one folder might easily be able to retrieve every file. For me, it is very useful to know the filename of the document I am searching for (as it is on my hardcopy) and to know that it is "sept-mon-rpt-final" and not "sept-mon-rpt-mikes-edits". As my example suggests, the greatest utility of this is for version control.
    I do not want to type my filename into every draft document, I want them to insert themselves in the header in the same manner that Pages inserts the current date. This information, filename and pathname, is in the Mac system. Indeed, there is a reference to it in the Pages documentation.
    In Pages'08 Help - the page titled: "Working with Document Parts" under "using Headers and Footers" it says, "Add headers and footers to give your documents page-by-page identity by showing the date and time, page number, or filename and pathname."
    When you click on the link that says "Using Headers and Footers" you are taken to that page, where it says, "you can put your own text or graphics in a header or footer, and you can use formatted text fields. Formatted text fields allow you to insert text that is automatically updated. For example, inserting the date field shows the current date whenever you open the document. Similarly, page number fields keep track of page numbers as you add or delete pages."
    After this you hit a dead end.

  • How to insert  data into BLOB column  using sql

    Hi all,
    How to insert data into BLOB column directly using sql .
    create  table temp
      a blob,
      b clob);
    SQL> /
    Insert into temp  values ('32aasdasdsdasdasd4e32','adsfbsdkjf') ;
    ERROR at line 1:
    ORA-01465: invalid hex number
    Please help in this.Thanks,
    P Prakash

    see this
    How to store PDF file in BLOB column without using indirect datastore

  • Error while inserting into blob column through PL/SQL

    Hi All,
    I am trying to insert into column having blob as datatype.
    INSERT INTO imagedb(image_name, content,description) VALUES ('logo.png',
    ?{file 'c:\logo.png'}, 'logo');
    it gives me error Unknown JDBC escape sequence:
    Is there anything wrong in above insert syntax for inserting into BLOB data type.
    Can any body please help me.
    Regards,
    Hiren

    It is not valid SQL as far as Oracle SQL is concerned. I assume that the file construct is suppose to replace that with the contents of the file?
    What happens when the file size exceeds the max length of the SQL command?
    And do you have any idea what will happen to the SQL Shared Pool on Oracle that needs to store the entire SQL command for every single SQL command passed to it? The whole purpose of the Shared Pool is for storing shared SQL. Not non-sharable SQL containing hardcoded values.
    Bind variable are to be used.. if you expect Oracle to perform like only Oracle can.
    And my bet is that you have not even bothered to read [url http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14249/toc.htm]Oracle® Database Application Developer's Guide - Large Objects guide....

  • Insert into blob(image) sql server 2000

    hello
    i want enter one image for example fish.jpg into blob into
    sql server 2000 plz help me...

    http://www.oracle.com/technology/sample_code/tech/java/sqlj_jdbc/files/advanced/LOBSample/LOBSample.zip
    this contains samples for using blob with oracle. use the idea for your code.

Maybe you are looking for