PL SQL File  Download - file name shows up as procedure name?

Hello,
I have been following the article below to create a download link to my db blobs, however when downloading the files, the file name appears as the procedure name as opposed to the desired file name.
http://download.oracle.com/docs/cd/E10513_01/doc/appdev.310/e10497/up_dn_files.htm#CIHDDJGF
any ideas why this is happening?
Thanks,
J

I've been having this exact problem all morning and I haven't found a workaround yet. The example posted by ptjurley doesn't quite clarify it for me. I am trying to play a video located in a table using an embedded windows media player. I'm working off these instructions: http://iadvise.blogspot.com/2007/10/apex-implementing-video-on-your-apex.html
This is the code for the otherwise blank HTML region on the page:
<object id="MediaPlayer" width=320 height=286 classid="CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95" standby="Loading Windows Media Player components..." type="application/x-oleobject" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112">
<param name="filename" value="#OWNER#.download_video_file?p_file_id=935">
<param name="Showcontrols" value="True">
<param name="autoStart" value="True">
<embed type="application/x-mplayer2" src="#OWNER#.download_video_file?p_file_id=935" name="MediaPlayer" width=720 height=540></embed>
</object>
Even when the filename and embed source is left blank like this: <param name="filename" value=""> I get the same error when trying to load the page. How exactly was this problem fixed, if it was resolved? I assume it's something to do with APEX not recognizing that #OWNER# is a variable within the HTML region, but I could be wrong.
Also, the code for my procedure differs from the example given in the above link, since APEX didn't like the way it was written. This is the download_video_file procedure I am trying to run:
create or replace PROCEDURE download_video_file(p_file_id IN HOMEPAGE_PHOTOS.id%TYPE) as
v_mime VARCHAR2(48);
v_length NUMBER;
v_file_name VARCHAR2(2000);
Lob_loc BLOB;
BEGIN
SELECT blob_content, mime_type, dbms_lob.getlength(blob_content) file_length, name
INTO Lob_loc,v_mime,v_length,v_file_name
FROM HOMEPAGE_PHOTOS
WHERE id = p_file_id;
owa_util.mime_header(v_mime, FALSE);
htp.p('Content-length: '||v_length);
htp.p('Content-Disposition: attachment;
filename="'||replace(replace(substr(v_file_name,instr(v_file_name, '/')+1),chr(10),null),chr(13),null)||'"');
owa_util.http_header_close;
wpg_docload.download_file(Lob_loc);
end download_video_file;
Edited by: user11293104 on Jun 22, 2009 12:41 PM

Similar Messages

  • How to get the SQL file name in SQL*plus

    hi all,
         I have created two sql file at C drive as "c:\Createtable.sql" and "c:\Deletetable.sql"
    afterwards i open
    C:\>sqlplus
    SQL*Plus: Release 10.2.0.1.0 - Production on Wed Jan 30 11:37:10 2008
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Enter user-name: scott/tiger
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
    SQL> @C:\Createtable.sql'
    Table created.
    SQL> @'C:\Deletetable.sql'
    Table dropped.
    SQL>My problem is to get the name of the file as "c:\createtable.sql" and "C:\Deletetable.sql" in sql*plus enviornment.
    Thanks & Regards
    Singh

    Dear Damorgan,
         >>your version number to three decimal places
         My Oracle DB Version i have already stated in my previous post is 10.2.0.1.0
    Actually my problem is to get the sql files name we run in sqlplus enviornment with @ symbol. like
    i have created one sql file in c drive as
    "C:\Createtable.sql"
    afterwords i have connected to sqlplus as
    sql> conn scott/tiger
    sql>@c:\createtable.sql
    Now i want some query to get the name of the file which is run.
    In actual my problem is as
    i have suppose 10 or more SQL files in some folder ( sql1.sql, sql2.sql, sql3.sql ....).
    i created one file to call all the 10 sql files (main.sql)
    i have also one track_table which will keep track that which sql file is runned.
    I want some automated script which will insert the record in that track_table....... for that i need the name of sql file which is runned.
    Hope this will help you.
    Thanks & Regards
    Singh

  • How to print .sql file name in the same file using sqlplus

    Oracle 10g on Linux platform.
    I am trying to print the name of .sql script file in that file but could not. Following is the file:
    test.sql
    select '&0' from dual;But instead of printing, it is asking for input:
    SQL> @test.sql
    Enter value for 0: Can any body give me a hint as how can i print the file name.

    Use this
    SELECT FNAME_KRBMSFT AS name FROM X$KRBMSFT
    and see
    SQL> create or replace procedure get_dir_list
    2 (p_directory varchar2)
    3 is
    4 l_null varchar2(100);
    5 l_directory varchar2(100);
    6 BEGIN
    7 l_directory := p_directory;
    8 sys.dbms_backup_restore.searchfiles(l_directory, l_null);
    9 FOR x IN (select fname_krbmsft fname from x$krbmsft) LOOP
    10 dbms_output.put_line(x.fname);
    11 END LOOP;
    12
    13 END;
    14 /
    Edited by: HuaMin Chen on Jun 26, 2012 12:26 PM

  • How to Run a .sql file from simple java class

    How to execute a .sql file consisting of Complex Queries,procedures through simple java class.
    The queries may have different delimiters,queries independant of each other.
    I am able to do with Specific De-limiter.But I need in such a way that there should not be any
    Constraints. Since My .sql may Contain different De-limiters.
    If any one can Suggest Some Solution.
    It will be Great Help.
    regards
    Anil

    Check out ibatis script runner, it' a third party library but quite handy for running sql files...
    m

  • How to show real file name on file download box when the file is downloaded

    Here is my procedure for downloading from Oracle database to the client, the file is stored in a Blob field, a DAD was defined with no errors, in fact the upload works with no errors. The files are in text format, the field MIME_TYPE has the value 'text/plain' and DAD_CHARSET is ascii.
    PROCEDURE download(p_filename IN VARCHAR2) IS
    BEGIN
    wpg_docload.download_file(p_filename);
    EXCEPTION
    WHEN OTHERS THEN
    htp.p(sqlerrm);
    RETURN;
    END;
    All functions are runing well, in fact it downloads with no errors but the file name that is suggested is the name of the package where the procedure es saved.
    How can the real file name be showed on here? it is the parameter p_filename
    I am using IE 6.0 SP 2, Oracle 10g Enterprise Edition Release 10.1.
    Thanks for help
    Yuri Lopez

    I forgot something, i am using Forms [32 bits] Versión 9.0.4.0.19 and using web.show_document with a call to the procedure in the DB

  • Show File name as download link in a report

    Hi people,
    In an application (APEX 4.2.1) I have a reprot whith a file donwload column. I implemented the download as a BLOB column with "DOWNLOAD" as Format Mask. This works fine, I can download attachments, no probs so far. However, I want the Download Text to show the name of the actual file instead of a static text "Download".
    Any suggestions on this?
    Kind regards,
    Vincent Deelen

    Hi fac586,
    Thanks for your reply.Actually, my first thougt was to use #FILE_NAME# reference, I tried it again, but it doesn't really work for me. I end up with a download link that reads exactly "#FILE_NAME#".
    I've put up an example in my demo app to show:
    http://apex.oracle.com/pls/apex/f?p=vincentdeelen:31:0:::::
    I've included screenshots of the page setup in the report.
    Regards,
    Vincent

  • Previously Firefox would show a number at the end of the file name (renaming the file by adding a number) showing that I had already downloaded a file at least once before. Recently that isn't happening. How do I get that feature back?

    When downloading, previously Firefox would show a number at the end of the file name (renaming the file by adding a number) showing that I had already downloaded a file at least once. Now that isn't happening. How do I get that feature back?

    When downloading, previously Firefox would show a number at the end of the file name (renaming the file by adding a number) showing that I had already downloaded a file at least once. Now that isn't happening. How do I get that feature back?

  • Downloading a pdf file, saving it, won't show the full name of the saving file when the name contains a space, stopping the file name.

    Downloading a pdf file, the name of the file contains a space in the middle of the file. The name showing on the 'Save' popup is the first few letters up to the space. Works fine on IE8. For instance, a file named "old snail_12345.pdf" would only show "old" (ignore the "s). This is on Firefox 30.0, WinXP Pro.

    Is this a problem when you are viewing the file in Firefox's built-in PDF Viewer and using its download button, or when you are using a download button in a web page?
    I've seen this problem occur when the server is pushing a different file name than the actual file name (for example, the file name is pdf.asp?id=12345 but the server is sending the name Annual Report.pdf in the headers sent with the file). I'm not aware of a workaround for the user, but for what it's worth, it is easy to fix on the server by replacing the spaces with %20 (the standard substitution used in web addresses).

  • When downloading files by internet download manager sometimes shows the file name of downloaded video as videoplayback instead of the original file name

    when downloading video files by the ( internet download manager) most of times the file name downloaded as ( video playback ) instead of actuly name of the files
    please let me know how to solve such problems?

    can you please also contact IDM support about it?
    * http://www.internetdownloadmanager.com/register/new_faq/main.cgi

  • File name not showing in grid view

    I just upgraded to LR 5.4 and I noticed that now when I am in grid view, only the capture date and dimensions show on the image when I run my cursor over it. I used to get a quick pop-up with the file name, capture date & dimensions, so I can quickly see where I am in my numbering system. I have looked at the preferences and also in view, but it is not apparent to me where it went, plus I know I didn't change anything, intentionally.
    BTW, I also upgraded to Mavericks OS on my iMac, but I hope that is not what is wrong. I know Adobe put out a bunch of "patches" for Bridge, etc. but I have already downloaded and updated all that.

    When you are in Library module/Grid mode, the text that appears in the hovering action is controlled by the Info Overlay. The Info Overlay has three states: Off, Info 1 and Info 2.
    Go to View>Loupe Overlay and put a check mark next to the Overlay you wish to be active and your hovering enabled text will change to match that text. 

  • Non US-ASCII characters in download file names

    I am trying to implement a simple file download in a JSP, and trying to get IE, Firefox and Opera to all display and handle non US-ASCII characters in the suggested download file name. Only concerned with Windows platform for now. Here's the code I am currently using:
    String agent = request.getHeader("USER-AGENT");
    if (null != agent && -1 != agent.indexOf("MSIE"))
    String codedfilename = URLEncoder.encode(cfrfilename, "UTF8");
    response.setContentType("application/x-download");
    response.setHeader("Content-Disposition","attachment;filename=" + codedfilename);
    else if (null != agent && -1 != agent.indexOf("Mozilla"))
    String codedfilename = MimeUtility.encodeText(cfrfilename, "UTF8", "B");
    response.setContentType("application/x-download");
    response.setHeader("Content-Disposition","attachment;filename=" + codedfilename);
    else
    response.setContentType("application/x-download");
    response.setHeader("Content-Disposition","attachment;filename=" + cfrfilename);
    }This URL encodes the file name if the browser is IE, MIME encodes it if the browser is Mozilla, and sends plain UTF-8 (the encoding of the JSP) for all other browsers. I get "cfrfilename" from translated properties files, and the string can contain characters from any character set - Chinese, Thai, Korean, etc.
    This code works correctly for IE - the file name is displayed correctly in the file Save as dialog, and it is saved correctly on disk, no matter which character set is used.
    For Firefox, the file name is displayed correctly in the file Save as dialog, but it is only saved correctly to disk if the file name is in a character set supported by the system locale. This seems to be a known Firefox bug (not fully using the Windows Unicode APIs), so nothing I can do about that.
    Nothing seems to work for Opera, however - I cannot get the file name to display correctly in the file Save as dialog, no matter which method I use (I have tried URL encoding and MIME encoding in addition to the plain UTF-8).
    Has anybody implemented something similar that works for at least these 3 browsers?

    I tested your code today,
                         dialog           save           open
    Firefox 1.5          OK                 OK               OK
    IE 6.0                OK                 OK                NGdailog: filename show in download popup dialog
    save: save to disk from dialog
    open: open directly from dailog

  • The files in download folder keeps adding _b to the file name

    I have a strange problem when downloading files on my Macbook Pro(running Mavericks). The name of the files being downloaded or already downloaded to the Download folder keep growing like this:
    Say for a file called My_file_name.zip, the system keeps adding _b to the name, it becomes
    My_file_name_b_b_b_b...._b.zip.
    And for big files, frequently I get the error message saying the file could not be downloaded due because there is no enough disk space. However the file is infact downloaded. I just need to highlight the .download and select Show Package Content, and copy the real file out of it. Howerer this is very annoying.
    This problems seems only happens when download files to the default Downoad folder. When downloading to other user selected folders, everything works fine, Please help if you know how to fix this issue.
    Thanks

    I get the error message saying the file could not be downloaded due because there is no enough disk space.
    How large is your HD and how much space do you have left?

  • Sort downloads by file name not type?

    Wondering if anyone can help me here. I'm trying to either make a script or automator workflow that will sort my downloads by file name, not file type.
    To cut to the point, I'd like say Reno 911, The Daily Show and the Colbert Report to go to a Comedy Central folder, My shows to go to my folder and my wife's to go to hers, just keep the downloads tidy as they come in instead of having to clean the downloads folder manually every day.
    There a easy way to do this?

    Why not have two separate user accounts - your's and your wife's. Then she can select her own download folder in Safari preferences, and you can select yours. Set up the folder to display in List View and click on the Name column as the sort column (twice for descending order.)

  • HT4101 I am trying to connect my JVC Hard Disk Drive Camcorder to my IPAD 2 via the Apple camera kit. I am able to down photos, but video files not showing. Camera shows Mass Stoarge. How can I download videos please.

    I am trying to connect my JVC Hard Disk Drive Camcorder to my IPAD 2 via the Apple camera kit. I am able to download photos, but video files not showing. Camera shows Mass Stoarge. How can I download videos please?

    The file name only has 6 characters and I'm not sure what the .mod format is. So that's why they are not seen by the iPad.
    Another way to transfer. You can use a USB flash drive & the camera connection kit.
    Plug the USB flash drive into your computer & create a new folder titled DCIM. Then put your movie/photo files into the folder. The files must have a filename with exactly 8 characters long (no spaces) plus the file extension (i.e., my-movie.mov; DSCN0164.jpg).
    Now plug the flash drive into the iPad using the camera connection kit. Open the Photos app, the movie/photo files should appear & you can import. (You can not export using the camera connection kit.)
    Secrets of the iPad Camera Connection Kit
    http://howto.cnet.com/8301-11310_39-57401068-285/secrets-of-the-ipad-camera-conn ection-kit/
     Cheers, Tom
    Look at this link for convertion the .mod format.
    http://www.makeuseof.com/tag/convert-mod-camcorder-video-format-mpg-instantly/
    Message was edited by: Texas Mac Man

  • Have recently updated Adobe Reader and now unable to open downloaded documents - Message received is could not open 'file name.pdf' because it is either not a supported file type or because the file has been damaged (for example, it was sent as an email a

    Have recently updated Adobe Reader and now unable to open downloaded documents - Message received is could not open 'file name.pdf' because it is either not a supported file type or because the file has been damaged (for example, it was sent as an email attachment and wasn't correctly decoded). When I check the file it shows Zero KB downloaded but the file appears - any suggestions?

    Obviously your download was not successful.
    What is your operating system?  How exactly do you download such files?

Maybe you are looking for