Weird characters displayed on page instead of file download/preview

Hi everyone,
I have a download file procedure as per the instructions on the download.oracle.com page
The download of the files worked just fine (or better say they were previewed in a new page) but recently a new schema has been added to the workspace so we can start the testings from the scratch.
I modified the schema name where needed, but not the download page acts kinda weird, as instead of the file preview, I get a long page full of:
�����JFIF�,,����&�Exif��MM�*������������������b�������j(�������1�������r2���������i�������������-����'�-����'Adobe Photoshop CS3 Windows�2008:07:28 16:41:20���������������������������]��������������������������&(�������������.������%��������H������H��������JFIF���H�H�����Adobe_CM�
The issue is that if I switch back to the old schema, the result is the same. So, anyone has any idea of what can cause this?
Thank you
Regards
Andrea

Hi John,
>
<Location /pls/nxdev>
Order deny,allow
PlsqlDocumentPath docs
AllowOverride None
PlsqlDocumentProcedure wwv_flow_file_manager.process_download
PlsqlDatabaseConnectString hostname:1521:... ServiceNameFormat
PlsqlNLSLanguage NORWEGIAN_NORWAY.AL32UTF8
PlsqlAuthenticationMode Basic
SetHandler pls_handler
PlsqlDocumentTablename wwv_flow_file_objects$
PlsqlDatabaseUsername APEX_PUBLIC_USER
PlsqlDefaultPage apex
PlsqlDatabasePassword pass
Allow from all
</Location>>
>
CREATE OR REPLACE procedure schema.dl_file (p_fileid in number)
as
l_mime varchar2(255);
l_length number;
l_filename varchar2(2000);
lob_loc BLOB;
begin
select col1,col2,col3,col4 into l_filename, l_length, l_mime, lob_loc from km_docs where kmd_id = p_fileid;
-- Set up HTTP header
-- Use an NVL around the mime type and if it is a null, set it to
-- application/octect - which may launch a download window from windows
owa_util.mime_header(nvl(l_mime,'application/octet'), FALSE );
-- Set the size so the browser knows how much to download
htp.p('Content-length: ' || l_length);
-- The filename will be used by the browser if the users does a "Save as"
htp.p('Content-Disposition: filename="' || l_filename || '"');
-- Close the headers
owa_util.http_header_close;
-- Download the BLOB
wpg_docload.download_file( Lob_loc );
end;
>
Thanks!
PS: Some updates...I tried it in IE as well (I use FF when working with applications) and funny enough the photos and documents get displayed/the download box shows up.
But, all the files have the name f. f.pdf, f.jpeg etc
I tried calling the dl_image procedure in the url (currently I call a new page where I pass the file id to an application id and then I call the above procedure in a pl/sql block):
http://www.host/pls/dad/schema.dl_file?p_fileid=1
And the name seems ok. I don't think it's a good idea to put the procedure name in the link, is it?
Edited by: AndreaC on Nov 18, 2008 3:30 PM

Similar Messages

  • Weird Characters on Web Pages

    I am suddenly seing weird "symbol" or "dingbat" characters on web pages instead of letters, and this is happening on all browsers I try (firefox, safari, explorer). How do I fix this?

    Most likely it's a bad font or font cache. Helvetica Fractions and Times Phonetic are the most common. See this note:
    http://discussions.apple.com/thread.jspa?threadID=932561&tstart=0
    If that doesn't help, email a screen shot (tom at bluesky dot org).

  • Pdf files in search results - open the properties paga instead the file

    Hi,
    We have 2010 search results page for searching files. When the search result is a pdf - the icon shown is not pdf icon and when click the file name it opens the properties page instead the file itself. What should be set? thanks a lot
    keren tsur

    It looks like you didn't register PDF file type in your search service application.
    Go to Central Administration->Manage Service Application. Click on the name of your search service application and check file types (link in the left column)

  • Weird characters displaying in Workflow Builder screen

    When I go to workflow builder, there are weird characters displaying on the screen.
    Some look like this:  | ) ` 
    I'm not sure what is causing this to happen.
    The workflow works, but I'm not sure why this is happening.
    with best regards,
    Orlando

    Check your SAPGUI, try to get the latest patch. Better to go for 7.10
    Regards, IA

  • I keep getting internet explorer cannot display web page when trying to download itunes. This only shows on half the page where the download link would be. My internet connection is fine.

    I keep getting internet explorer cannot display web page when trying to download itunes. This only shows on half the page where the download link would be. My internet connection is fine.  Any idea what the problem may be?

    You won't see anything obviously related to iCloud, Jimmy. But if you go to the home iTunes Store page while logged into your iTunes Store account, you should see a Purchases link now under the Quick Links header. That's the only part of iCloud active at this time.
    Regards.

  • Weird characters appear after write to a file

    Here is my story:
    I open a file using RandomAccessFile to replace some characters inside it. Let's say I have in the file string 4000, I replace it by string 400. It works fine.
    Now if I replace this number by string 40000, when I check the text file, some weird characters like ^M appear everywhere at the end of lines.
    What's the reason and how to solve it? I believe there is some invisible characters at the end of string 4000 that causes the problem.
    Note that I use function writeBytes to write strings into the file.

    public static void changeFileRAF(String sFile, String paramName, String paramValue) {
    try {
    RandomAccessFile rf = new RandomAccessFile(sFile, "rws");
    String currentLine;
    long pos;
    while (true) {
    pos = rf.getFilePointer();
    currentLine = rf.readLine();
    if (currentLine == null)
    break;
    if (currentLine.trim().startsWith(paramName)) {
    rf.seek(pos);
    char[] replaceLine = currentLine.toCharArray();
    char[] value = paramValue.toCharArray();
    int i = 0;
    //pass all white space characters
    while (i < replaceLine.length && Character.isWhitespace(replaceLine)) {
    i++;
    //pass all characters representing tag name
    while (i < replaceLine.length && !Character.isWhitespace(replaceLine[i])) {
    i++;
    //again, pass all white space characters
    while (i < replaceLine.length && Character.isWhitespace(replaceLine[i])) {
    i++;
    if (i == replaceLine.length) {//no value, do nothing                                                           
    return;
    int oldValueLength = replaceLine.length - i;
    String newLine = System.getProperty("line.separator");
    if (oldValueLength >= value.length) {
    System.out.println("different: " + (oldValueLength - value.length));
    for (int j = 0; j < value.length; j++)
    replaceLine[j + i] = value[j];
    for (int j = value.length; j < oldValueLength; j++)
    replaceLine[j + i] = ' ';
    rf.writeBytes(String.copyValueOf(replaceLine));
    else {
    System.out.println("old value length: " + oldValueLength);
    System.out.println("new value length: " + value.length);
    char[] compensation = new char[value.length - oldValueLength];
    for (int j = 0; j < oldValueLength; j++)
    replaceLine[j + i] = value[j];
    for (int j = oldValueLength; j < value.length; j++)
    compensation[j - oldValueLength] = value[j];
    System.out.println("it is " + String.copyValueOf(replaceLine) + String.copyValueOf(compensation));
    rf.writeBytes(String.copyValueOf(replaceLine) + String.copyValueOf(compensation));
    break;
    rf.close();
    } catch (IOException e) {
    System.out.println(e.getMessage());
    I hope it's not too long.

  • German special characters not displaying on page instead of that Question marks displayed

    when i submit form,i need to send a mail with filled data.Here Suppose user entered german special characters.I am getting Question marks instead of ä,Ä,ö,Ö,ü,Ü,ß. I have used meta tag like
    <meta http-equiv="content-type" content="text/html;charset=utf-8" />.But i am getting fine characters with IE and Chrome.I am using FireFox 3.6.16 english.

    Hello core team,
    Thanks a lot!!!!
    i m not only the person to use html form.So many non technical persons using the same. how can i tell to all persons regarding changing character encoding. i need some permenant solution,

  • [SOLVED] Weird characters in man pages

    Hi,
    I remember I had read a similar thread, but I can't find it anymore.
    My problem is that man pages show strange characters and it's quite difficult to read at times. Here is an example:
    The traditional protocol for writing to someone is that the string <80><98>-o', either at the end of a line or on a line by itself, means that it's the other person's turn to talk.   The  string
           <80><98>oo' means that the person believes the conversation to be over.
    How do I fix this?
    Thanks.
    Last edited by finferflu (2008-02-27 17:53:23)

    Hello
    Here is a post on that problem if you can read french : http://forums.archlinuxfr.org/viewtopic.php?id=1084
    The members suggested to replace
    export LESSCHARSET="utf8"
    by
    export LESSCHARSET="UTF-8"
    in /etc/profile.
    One suggest to replace the line inside /etc/man.conf (from the gentoo wiki fr)
    NROFF iconv -f utf8 -t iso8859-1 | /usr/bin/nroff -Tlatin1 -c -mandoc
    I must admit that it doesn't work for me neither, and the above does not solve the problem. The file I tested is UTF-8 encoded and the LESSCHARSET defined to use UTF-8 gives badly accentuated characters (But at least printable characters). I think you will have to tweak a little these lines, but it's a start.
    Note that these lines suit (or don't suit) french man pages, but you may have to change the given charsets (especially latin1).
    Hope it will help you search
    Cilyan
    Edit: Ah, time to write the answer, the problem is solved !
    Edit2: The tip given by dyscoria does not work for me.
    Last edited by Cilyan (2008-02-27 18:01:57)

  • Weird characters displayed after Windows update

    A user encountered this issue after a Windows update.
    https://twitter.com/summerscope/status/414887724131168256/photo/1
    Did anyone encounter this too, and what did you do?
    Thanks in advance.
    serene
    Community Advocate Program Manager
    English Community   Deutsche Community   Comunidad en Español   Русскоязычное Сообщество

    Hi John,
    >
    <Location /pls/nxdev>
    Order deny,allow
    PlsqlDocumentPath docs
    AllowOverride None
    PlsqlDocumentProcedure wwv_flow_file_manager.process_download
    PlsqlDatabaseConnectString hostname:1521:... ServiceNameFormat
    PlsqlNLSLanguage NORWEGIAN_NORWAY.AL32UTF8
    PlsqlAuthenticationMode Basic
    SetHandler pls_handler
    PlsqlDocumentTablename wwv_flow_file_objects$
    PlsqlDatabaseUsername APEX_PUBLIC_USER
    PlsqlDefaultPage apex
    PlsqlDatabasePassword pass
    Allow from all
    </Location>>
    >
    CREATE OR REPLACE procedure schema.dl_file (p_fileid in number)
    as
    l_mime varchar2(255);
    l_length number;
    l_filename varchar2(2000);
    lob_loc BLOB;
    begin
    select col1,col2,col3,col4 into l_filename, l_length, l_mime, lob_loc from km_docs where kmd_id = p_fileid;
    -- Set up HTTP header
    -- Use an NVL around the mime type and if it is a null, set it to
    -- application/octect - which may launch a download window from windows
    owa_util.mime_header(nvl(l_mime,'application/octet'), FALSE );
    -- Set the size so the browser knows how much to download
    htp.p('Content-length: ' || l_length);
    -- The filename will be used by the browser if the users does a "Save as"
    htp.p('Content-Disposition: filename="' || l_filename || '"');
    -- Close the headers
    owa_util.http_header_close;
    -- Download the BLOB
    wpg_docload.download_file( Lob_loc );
    end;
    >
    Thanks!
    PS: Some updates...I tried it in IE as well (I use FF when working with applications) and funny enough the photos and documents get displayed/the download box shows up.
    But, all the files have the name f. f.pdf, f.jpeg etc
    I tried calling the dl_image procedure in the url (currently I call a new page where I pass the file id to an application id and then I call the above procedure in a pl/sql block):
    http://www.host/pls/dad/schema.dl_file?p_fileid=1
    And the name seems ok. I don't think it's a good idea to put the procedure name in the link, is it?
    Edited by: AndreaC on Nov 18, 2008 3:30 PM

  • HP 895CSE Prints Weird Characters on 1st Page per Print Job

    My printing always prints one line of characters on the 1st page, followed by the correct document on the second. When I had the previous operating system, no problem like this occurred. I have reinstalled the printer driver for OS 10.5, still same result. Any suggestions?

    My printing always prints one line of characters on the 1st page, followed by the correct document on the second. When I had the previous operating system, no problem like this occurred. I have reinstalled the printer driver for OS 10.5, still same result. Any suggestions?

  • Weird characters displaying in Safari and Apple Mail

    I have a macbook air 13in, its been working terrific for the last 3 weeks. However, today Apple mail is garbling email messages and Safari is not rendering web pages correctly? I tried rebooting, shutting down my router, everything, still there.
    Strangely, Chrome is rendering the pages without any issues.
    What possibly could be wrong? Does anyone else have this issue?
    Any help is appreciated.

    I fixed my issue, here is what I did:
    1. Delete Safari
    2. Downloaded it and re-installed.
    3. Did the same for Google Chrome which was crashing on adobe flash consistently.
    4. All better now for Apple Mail, Safari, and Chrome.
    Somehow some Safari file must have gotten corrupted.

  • Display Web page in SWF file?

    I want to use flash to build a desktop application for our
    touchscreen kiosk... And I need a button that will open a web page
    inside of flash... and not using IE or FF... If I use IE with
    getURL... and the user happens to touch outside of the browser
    window, IE will fall behind the flash desktop app that's
    fullscreen...
    Can this be done?
    thanks in advance...

    This is a job for Director or VB. Or a flash interface on top
    of vb with an
    ActiveX IE browser. If there is a form, Director hogs the tab
    keys which
    people don't like. I have several of these out in kiosks and
    VB worked best.
    "KevyKevRR" <[email protected]> wrote in
    message
    news:f7lg46$p3g$[email protected]..
    >I want to use flash to build a desktop application for
    our touchscreen
    >kiosk...
    > And I need a button that will open a web page inside of
    flash... and not
    > using
    > IE or FF... If I use IE with getURL... and the user
    happens to touch
    > outside
    > of the browser window, IE will fall behind the flash
    desktop app that's
    > fullscreen...
    >
    > Can this be done?
    >
    > thanks in advance...
    >

  • How to skip(do not wnat to get display) save dialogue box for file download

    I am having servlet for downlading a file from server. When I call this servelt I am able to get the file from server but I get a save dialog box which I do not want. I want that this file should be stored at a specific location given by me in a servlet.
    So haoe I can avoid that save dialog box and where I should specify the specific location?
    Thanks in advance
    package com.txcs.sms.server.servlet;
    import java.io.*;
    import java.util.zip.GZIPOutputStream;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class DownloadServlet extends HttpServlet
        public DownloadServlet()
            separator = "/";
            root = ".";
        public void init(ServletConfig servletconfig)
            throws ServletException
            super.init(servletconfig);
            context = servletconfig.getServletContext();
            String s;
            if((s = getInitParameter("dir")) == null)
                s = root;
            separator = System.getProperty("file.separator");
            if(!s.endsWith(separator) && !s.endsWith("/"))
                s = s + separator;
            root = s;
        public void doGet(HttpServletRequest httpservletrequest, HttpServletResponse httpservletresponse)
            throws ServletException, IOException
            doPost(httpservletrequest, httpservletresponse);
        public void doPost(HttpServletRequest httpservletrequest, HttpServletResponse httpservletresponse)
            throws ServletException, IOException
            Object obj = null;
            String s = "";
            s = HttpUtils.getRequestURL(httpservletrequest).toString();
            int i;
            if((i = s.indexOf("?")) > 0)
                s = s.substring(0, i);
            String s1;
            if((s1 = httpservletrequest.getQueryString()) == null)
                s1 = "";
            else
                s1 = decode(s1);
            if(s1.length() == 0)
                httpservletresponse.setContentType("text/html");
                PrintWriter printwriter = httpservletresponse.getWriter();
                printwriter.println("<html>");
                printwriter.println("<br><br><br>Could not get file name ");
                printwriter.println("</html>");
                printwriter.flush();
                printwriter.close();
                return;
            if(s1.indexOf(".." + separator) >= 0 || s1.indexOf("../") >= 0)
                httpservletresponse.setContentType("text/html");
                PrintWriter printwriter1 = httpservletresponse.getWriter();
                printwriter1.println("<html>");
                printwriter1.println("<br><br><br>Could not use this file name by the security restrictions ");
                printwriter1.println("</html>");
                printwriter1.flush();
                printwriter1.close();
                return;
            File file = lookupFile(root + s1);
            if(file == null)
                httpservletresponse.setContentType("text/html");
                PrintWriter printwriter2 = httpservletresponse.getWriter();
                printwriter2.println("<html>");
                printwriter2.println("<br><br><br>Could not read file " + s1);
                printwriter2.println("</html>");
                printwriter2.flush();
                printwriter2.close();
                return;
            if(!file.exists() || !file.canRead())
                httpservletresponse.setContentType("text/html");
                PrintWriter printwriter3 = httpservletresponse.getWriter();
                printwriter3.println("<html><font face=\"Arial\">");
                printwriter3.println("<br><br><br>Could not read file " + s1);
                printwriter3.print("<br>Reasons are: ");
                if(!file.exists())
                    printwriter3.println("file does not exist");
                else
                    printwriter3.println("file is not readable at this moment");
                printwriter3.println("</font></html>");
                printwriter3.flush();
                printwriter3.close();
                return;
            String s2 = httpservletrequest.getHeader("Accept-Encoding");
            boolean flag = false;
            if(s2 != null && s2.indexOf("gzip") >= 0 && "true".equalsIgnoreCase(getInitParameter("gzip")))
                flag = true;
            if(flag)
                httpservletresponse.setHeader("Content-Encoding", "gzip");
                httpservletresponse.setHeader("Content-Disposition", "attachment;filename=\"" + s1 + "\"");
                javax.servlet.ServletOutputStream servletoutputstream = httpservletresponse.getOutputStream();
                GZIPOutputStream gzipoutputstream = new GZIPOutputStream(servletoutputstream);
                dumpFile(root + s1, gzipoutputstream);
                gzipoutputstream.close();
                servletoutputstream.close();
            } else
                httpservletresponse.setContentType("application/octet-stream");
                httpservletresponse.setHeader("Content-Disposition", "attachment;filename=\"" + s1 + "\"");
                javax.servlet.ServletOutputStream servletoutputstream1 = httpservletresponse.getOutputStream();
                dumpFile(root + s1, servletoutputstream1);
                servletoutputstream1.flush();
                servletoutputstream1.close();
        private String getFromQuery(String s, String s1)
            if(s == null)
                return "";
            int i = s.indexOf(s1);
            if(i < 0)
                return "";
            String s2 = s.substring(i + s1.length());
            if((i = s2.indexOf("&")) < 0)
                return s2;
            else
                return s2.substring(0, i);
        private void dumpFile(String s, OutputStream outputstream)
            String s1 = s;
            byte abyte0[] = new byte[4096];
            try
                BufferedInputStream bufferedinputstream = new BufferedInputStream(new FileInputStream(lookupFile(s1)));
                int i;
                while((i = bufferedinputstream.read(abyte0, 0, 4096)) != -1)
                    outputstream.write(abyte0, 0, i);
                bufferedinputstream.close();
            catch(Exception exception) { }
        private String decode(String s)
            StringBuffer stringbuffer = new StringBuffer(0);
            for(int i = 0; i < s.length(); i++)
                char c = s.charAt(i);
                if(c == '+')
                    stringbuffer.append(' ');
                else
                if(c == '%')
                    char c1 = '\0';
                    for(int j = 0; j < 2; j++)
                        c1 *= '\020';
                        c = s.charAt(++i);
                        if(c >= '0' && c <= '9')
                            c1 += c - 48;
                            continue;
                        if((c < 'A' || c > 'F') && (c < 'a' || c > 'f'))
                            break;
                        switch(c)
                        case 65: // 'A'
                        case 97: // 'a'
                            c1 += '\n';
                            break;
                        case 66: // 'B'
                        case 98: // 'b'
                            c1 += '\013';
                            break;
                        case 67: // 'C'
                        case 99: // 'c'
                            c1 += '\f';
                            break;
                        case 68: // 'D'
                        case 100: // 'd'
                            c1 += '\r';
                            break;
                        case 69: // 'E'
                        case 101: // 'e'
                            c1 += '\016';
                            break;
                        case 70: // 'F'
                        case 102: // 'f'
                            c1 += '\017';
                            break;
                    stringbuffer.append(c1);
                } else
                    stringbuffer.append(c);
            return stringbuffer.toString();
        public String getServletInfo()
            return "A DownloadServlet servlet ";
        private File lookupFile(String s)
            File file = new File(s);
            return file.isAbsolute() ? file : new File(context.getRealPath("/"), s);
        private static final String DIR = "dir";
        private static final String GZIP = "gzip";
        private ServletContext context;
        private String separator;
        private String root;
        private static final String VERSION = "ver. 1.6";
        private static final String CPR = "A DownloadServlet servlet ";
    }

    Can't be done, for obvious security reasons.
    Would you want someone downloading something into your windows\system directory when you navigate to their webpage?

  • Need my custom webauth page displayed with HTTP instead of HTTPS

    I have a custom webauth page installed that I am using with web passthrough authentication on my WLC2006 in order to put up a acceptable use policy page.
    The WLC uses HTTPS to display this which causes a security certificate warning to appear if I go with the WLC's own self-signed certificate. Is there a way I can get the WLC to use plain HTTP to display this page instead so I can eliminate the warning?
    I have already tried installing a trusted 3rd party certificate on the WLC, but I have this very strange problem where mucking with the WLC's web authentication certificate in any manner causes all network activity on the WLC to break except for CDP and ARP, essentially leaving the WLC dead. Three weeks of troubleshooting with Cisco TAC has yielded no progress on that front so now I am trying to bypass the need for a security certificate altogether since I really don't need to encrypt my acceptable use policy page.

    The documentation doesn't provide very clear direction, does it?
    To download the WLC's default webauth page, browse to the controller's Security > Web Login Page. Make sure the web authentication type is Internal (Default). Hit the Preview button. Then use your browser's File > Save As... menu item to save the HTML into a file. Edit this to your liking and bundle it and any graphics images up into a TAR archive, then upload via the controller's COMMAND page.

  • Weird characters in known_hosts file

    We have a Solaris 9 Client system that does ssh to other Solaris servers.
    StrictHostKeyChecking is set to "No" in /etc/ssh_known_hosts.
    Even when the public host key of the servers do not change we see that there are multiple entries in $HOME/.ssh/known_hosts file of the client.
    How can this happen?
    And some times, we have weird characters in place of the ip address and encryption algorithm, while the actual key is properly written into known_hosts file.
    How these weird characters are put into the known_hosts file?
    If anyone can provide the answers, it will be of great help.
    Thanks in advance.

    not sure i follow fully, can you check for this setting:
    HashKnownHosts yes
    in ssh_config. this will hash keys in known_hosts to make it unreadable...

Maybe you are looking for