Post BLOB image in an html content

I have a HTML content which will go as a body of the email to be sent to various users.
Now in the email, somewhere there is a tag
<img src="[IMG]"/>
We need to replace the [IMG] with the image link store in the database column, so that the email receiver can see the image there.
Any help
Thanks
Deb

Hi Tony
I am using something like this
<img src="WRT.DISPLAY_TEMPLATE_IMAGE?inid=189" width="100%" border="0" >
where DISPLAY_TEMPLATE_IMAGE is a procedure with the following code
create or replace
PROCEDURE display_template_image (inid NUMBER)
AS
vmime VARCHAR2 (48);
vlength NUMBER;
vfilename VARCHAR2 (2000);
vblob BLOB;
BEGIN
SELECT ctl_image_mime_type
, ctl_image
, ctl_image_filename
, DBMS_LOB.getlength (ctl_image)
INTO vmime
, vblob
, vfilename
, vlength
FROM contact_templates
WHERE ctl_id = inid;
OWA_UTIL.mime_header (NVL (vmime, 'application/octet'), FALSE);
HTP.p ('Content-length: ' || vlength);
OWA_UTIL.http_header_close;
WPG_DOCLOAD.download_file (vblob);
END;
The above procedure works fine when I use it in a IR report query. but not in a HTML script.
Thanks
Debraj

Similar Messages

  • Is it possible to add a poster frame to video in HTML Resources

    I have several videos that will be repeated throughout a folio, so I have made the HTML Resource zip containing them, how do I control the appearance?
    If I put a image behind the HTML Content and set the web overlay to transparent I just get a black box, If I set the web overlay to autoplay I just get a white box with a play symbol. so is there anyway to specify a custom poster frame?

    I've also tried adding the image as a background image in the HTML but the default white poster frame sits on top of this

  • Setting html content with setContent() does never show images

    I've an application set sets dynamically generated html-content in a webview node by using the webengine.setContent() method. This generated html content uses image-tags.
    Here's the problem: the image is not displayed. I tried all variations (absolute url like "http://localhost/c:/test.png" or "file://c:/test.png", relative urls like "test.png" with png in jar-file).
    Anyone out there who has a workaround for me? I appreciate any comment.

    one non-working apple <img src="apple.png"> You loaded the page content with loadcontent, then inside the page content provided a relative url. This is likely an error.
    The question is, what is this url relative to?
    The answer is either likely undefined as no protocol was used to load the page content and so it can't be determined how to load the relative url resource.
    and two non-working peaches <img src="http://localhost/c:/peaches.png">
    You attempted to load content using the http protocol server on the localhost, but you have no such server on the host, so this cannot work.
    and a working remote image url <img src="http://docs.oracle.com/javafx/javafx/images/javafx-documentation.png">
    This works because you fully specified how to load the content by providing the protocol and valid resource reference.
    OK, so the question remains how do you images from the local drive?
    There are three options for this in the following code.
    package org.jewelsea.examples.webviewlocal;
    import javafx.application.Application;
    import javafx.beans.value.*;
    import javafx.scene.Scene;
    import javafx.scene.layout.FlowPane;
    import javafx.scene.web.WebView;
    import javafx.stage.Stage;
    /** Example of a webview loading resources from the file system. */
    public class WebViewLocal extends Application {
      public static void main(String[] args) throws Exception {
    //    URL.setURLStreamHandlerFactory(new HandlerFactory());
        launch(args);
      public void start(final Stage stage) throws Exception {
        final FlowPane layout = new FlowPane();
        WebView webView = new WebView();
        webView.getEngine().load("file:///C:\\dev\\gettingstarted\\timeforgotten.html");
    //    webView.getEngine().load("jar:file:///C:\\dev\\javafx\\JavaFXidea\\out\\artifacts\\JavaFXidea_jar\\JavaFXidea.jar!/org/jewelsea/examples/webviewlocal/timeforgotten.html");
    //    webView.getEngine().load("resource:///org/jewelsea/examples/webviewlocal/timeforgotten.html");
        webView.getEngine().getLoadWorker().exceptionProperty().addListener(new ChangeListener<Throwable>() {
          @Override public void changed(ObservableValue<? extends Throwable> observableValue, Throwable oldThrowable, Throwable newThrowable) {
            System.out.println("Load exception: " + newThrowable);
        // layout the scene.
        layout.getChildren().addAll(webView);
        Scene scene = new Scene(layout, 1000, 600);
        webView.prefWidthProperty().bind(scene.widthProperty());
        webView.prefHeightProperty().bind(scene.heightProperty());
        stage.setScene(scene);
        stage.show();
    }which loads the following html file:
    <html>
    <head>
      <style type="text/css">p { color: sienna; font-size: 20px; text-align: center; }</style>
    </head>
    <body bgcolor="cornsilk">
    <p><em>
        <br/>
        On either side the river lie,<br/>
        Long fields of barley and of rye,<br/>
        And through the fields a road runs by,<br/>
        To many towered Camelot.
    </em></p>
    <p><img src="camelot.jpg"/></p>
    </body>
    </html>If you want to test this example the camelot.jpg image is downloadable from http://www.timelessmyths.com/arthurian/gallery/camelot.jpg.
    Option 1: The file:// protocol for lookup from the filesystem.
    This is the most straight-forward as it is just based on standard html layout in the filesystem - just place your html and it's relative referenced images somewhere in your filesystem in locations relative to each other - if your browser loads it properly, then your webengine will to if you give it the right file:// path.
    In the case of file:///C:\\dev\\gettingstarted\\timeforgotten.html, timeforgotten.html is placed in c:\dev\gettingstarted and camelot.jpg image is placed in the same directory.
    Option 2: The jar:file:// protocol for lookup from a jar hosted on the filesystem.
    This makes use of the http://docs.oracle.com/javase/7/docs/api/java/net/JarURLConnection.html to find your resources.
    If your application resources are packaged in a jar file (could be the same jar file as your main application class) then you can reference the jar file through the file protocol, then pick out the resources packaged in the jar file via their relative paths.
    Option 3: The resource:// protocol for lookup based on the classpath.
    This type of resource lookup is the one most Java programmers are familiar with - a classloader is used to load a resource. The pattern is widely used in web application frameworks on the server. But usually the means to do this is via a classloader.getResource() call, not via a URL.
    Java does not, by default, have a URL protocol handler for looking up resources on the classpath, so if you want to do this, it is necessary to create your own protocol and install it.
    The installation function is the commented out line: // URL.setURLStreamHandlerFactory(new HandlerFactory());
    It is a system wide call for the VM and should be called (just once) before any URL Connections are established.
    To get this to work I used a resource handler from http://www.arakhne.org/arakhneVmutils/index.html which included the following classes:
      java.org.arakhne.vmutil.resource.Handler
      java.org.arakhne.vmutil.resource.HandlerFactory
      java.org.arakhne.vmutil.resource.URLConnection
      java.org.arakhne.vmutil.ClassLoaderFinder
      java.org.arakhne.vmutil.Resources
      java.org.arakhne.vmutil.ResourceNotFoundException
      java.org.arakhne.vmutil.URISchemeType
      java.org.arakhne.vmutil.URLHandlerUtilDetails on how all this works are in http://java.sun.com/developer/onlineTraining/protocolhandlers/ which defines "A New Era for Java Protocol Handlers" by defining a URL handler extension mechanism which is hardly ever used.
    As a final note to my way overly long forum post, when the WebEngine doesn't process the urls sometimes you can get info on what went wrong via the monitoring the loadWorker's exception property, but sometimes I was able to get more complete stack traces by trying to open a connection on a URL to see if I had got the URL correct - for example:
        URL url = new URL("jar:file:///C:\\dev\\javafx\\JavaFXidea\\out\\artifacts\\JavaFXidea_jar!/org/jewelsea/examples/webviewlocal/timeforgotten.html");
        url.openConnection();Anyway, just using the file:// protocol in webEngine.load() will probably accomplish what you need.
    Note that if it is a webstart or browser embedded app, then you'll need to sign it if you want to access the local file system.

  • Html content to image saver

    Hi,
    how to convert html content to image(using image saver) help of BLS Action Block
    Thanks
    Ramesh

    Ramesh,
    I'm not sure your question is very clear. Why are you trying to convert HTML to an image?
    I can assume that your experience with xMII is very limited....?
    Some recommedations are as follows:
    1) Take the xMII training...it's very helpful!
    2) Read the xMII Help guide...it comes packaged with the xMII install and can be accessed from the xMII Portal page on the top right corner of the page.
    3) Reference the xMII Wiki for additional info:  <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/wiki?path=/display/xmii/main&">xmii WIKI...Click Here!</a>
    And as always the best way to see how something works is to TRY it out. Read the help, then post in this community and explain what you have done and tried so that we can help out with what else you can try.
    Questions which ask us to do your work are not very productive for you, or the community as a whole.

  • I want to display BLOB image in JSP Using  html tags IMG src=

    GoodAfternoon Sir/Madom
    I Have got the image from oracle database but want to display BLOB image using <IMG src="" > Html tags in JSP page . If it is possible than please give some ideas or
    Send me sample codes for display image.
    This code is ok and working no problem here Please send me code How to display using html tag from oracle in JSP page.
    <%@ page import="java.sql.*" %>
    <%@ page import="java.io.*" %>
    <%@ page import="javax.swing.ImageIcon;" %>
          <%
            out.print("hiiiiiii") ;
                // declare a connection by using Connection interface
                Connection connection = null;
                /* Create string of connection url within specified format with machine
                   name, port number and database name. Here machine name id localhost
                   and database name is student. */
                String connectionURL = "jdbc:oracle:thin:@localhost:1521:orcl";
                /*declare a resultSet that works as a table resulted by execute a specified
                   sql query. */
                ResultSet rs = null;
                // Declare statement.
                PreparedStatement psmnt = null;
                  // declare InputStream object to store binary stream of given image.
                   InputStream sImage;
                try {
                    // Load JDBC driver "com.mysql.jdbc.Driver"
                    Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
                        /* Create a connection by using getConnection() method that takes
                        parameters of string type connection url, user name and password to
                        connect to database. */
                    connection = DriverManager.getConnection(connectionURL, "scott", "root");
                        /* prepareStatement() is used for create statement object that is
                    used for sending sql statements to the specified database. */
                    psmnt = connection.prepareStatement("SELECT image FROM img WHERE id = ?");
                    psmnt.setString(1, "10");
                    rs = psmnt.executeQuery();
                    if(rs.next()) {
                          byte[] bytearray = new byte[1048576];
                          int size=0;
                          sImage = rs.getBinaryStream(1);
                        //response.reset();
                          response.setContentType("image/jpeg");
                          while((size=sImage.read(bytearray))!= -1 ){
                response.getOutputStream().write(bytearray,0,size);
                catch(Exception ex){
                        out.println("error :"+ex);
               finally {
                    // close all the connections.
                    rs.close();
                    psmnt.close();
                    connection.close();
         %>
         Thanks

    I have done exactly that in one of my applications.
    I have extracted the image from the database as a byte array, and displayed it using a servlet.
    Here is the method in the servlet which does the displaying:
    (since I'm writing one byte at a time, it's probably not terribly efficient but it works)
         private void sendImage(byte[] bytes, HttpServletRequest request, HttpServletResponse response) throws IOException {
              ServletOutputStream sout = response.getOutputStream();
              for(int n = 0; n < bytes.length; n++) {
                   sout.write(bytes[n]);
              sout.flush();
              sout.close();
         }Then in my JSP, I use this:
    <img src="/path-to-servlet/image.jpg"/>
    The name of the image to display is in the URL as well as the path to the servlet. The servlet will therefore need to extract the image name from the url and call the database.

  • HTML content with images and links blocked

    Hello,
    I very much need some help here because my company needs to send out newsletters to our clients in HTML format soon and so far the email with HTML content is being blocked as spam while text content works fine. Specifically, whenever I add a link or an image in HTML content, the email doesn't go through. I tried sending in multipart format but it is also not sending HTML with images and links. Here is my attempt:
                                    props.setProperty("mail.transport.protocol", "smtp");
                                     props.setProperty("mail.host", "mail.server.com");
                                     props.setProperty("mail.user", "joeuser");
                                     Session mailSession = Session.getDefaultInstance(props, null);
                                     mailSession.setDebug(true);
                                     Transport transport = mailSession.getTransport();
                                     MimeMultipart mp = new MimeMultipart("alternative");
                                     MimeBodyPart htmlPart = new MimeBodyPart();
                                     MimeBodyPart textPart = new MimeBodyPart();
                                     textPart.setText("Just to make it multipart");
                                     htmlPart.setHeader("MIME-Version", "1.0");
                                     htmlPart.setHeader("Content-Type", htmlPart.getContentType());
                                     htmlPart.setContent(strHtmlMessage, "text/html");
                                     mp.addBodyPart(textPart);
                                     mp.addBodyPart(htmlPart);
                                     MimeMessage message = new MimeMessage(mailSession);
                                     message.setHeader("MIME-Version", "1.0");
                                     message.setHeader("Content-Type", mp.getContentType());
                                     message.setHeader("X-Mailer", "Recommend-It Mailer V2.03c02");
                                     message.setContent(mp);
                                     message.setSubject(strSubject);
                                     message.setFrom(new InternetAddress("[email protected]"));
                                     message.addRecipient(Message.RecipientType.TO,
                                             new InternetAddress("[email protected]"));
                                             transport.connect();
                                             transport.sendMessage(message,
                                             message.getRecipients(Message.RecipientType.TO));
                                     transport.close();This code is one of my numerous attempts to make HTML send images and links. Please, let me know if there is a workaround way to make JavaMail send HTML with links and images in the message body. Your help will be greatly appreciated.

    The JavaMail FAQ has information on creating HTML messages, including
    messages with both plain text and HTML. Did you find it?
    BTW, your code has many unnecessary statements, such as setting
    the Mime-Version header, which JavaMail will do for you, and setting
    the Content-Type header, which JavaMail does as a side-effect of the
    setContent or setText calls.
    Other than that, it looks like your code should be correctly creating a
    multipart/alternative message. If the recipient is still rejecting it you
    need to figure out what it is about the message that makes the recipient
    think it's spam. Can you send a similar message using another mailer?
    Can you send the message to a different recipient?

  • How to display html content with image in Adobe Flash and Flex mobile project?

    Hi,
      I have a html content with image in it. How to display it in Adobe Flash Builder and Flex mobile project? Which control needs to be used for this?

    Hello,
    The only current way is to use an iFrame, or if you only need some html tags you could use the Text Layout Framework.
    Here this is the iFrame approach:
    http://code.google.com/p/flex-iframe/
    If the swc do not work in Flex4 just use its ource code which works...
    ...it is basically based on this:
    http://www.deitte.com/archives/2008/07/dont_use_iframe.htm
    see also and vote, please:
    http://bugs.adobe.com/jira/browse/SDK-12291
    http://bugs.adobe.com/jira/browse/SDK-13740
    Regards
    Marc

  • Problem posting HTML content in WebForms

    I apologize in advance if this is posted in the wrong location; I cannot find a form for Webforms or ASP.NET in the listings.  (I also apologize if this is a duplicate question; I had trouble submitting it the first time.)
    I'm updating an existing WebForms application for a relative who will undoubtedly find lots of little details for me to fix over the next few weeks.  In order to reduce the number of service calls, I'm implementing a "site config" feature that
    will enable him to modify some of the site elements himself, such as toggling the display of certain labels or repositioning the hit count.  The configuration isn't being stored in a database, but rather in an XML document in the site root.  Each
    time the form is used to update the XML, a backup is saved, and the site can revert to a previous version if the current config becomes hosed.  In short, I'm not particularly concerned about malicious code going into the XML, although I do have some validation
    in place to make sure he doesn't screw things up.
    I'd like the config to be able to hold some HTML, so that he can apply custom formatting to the elements he configures, and I have of course applied Server.HtmlEncode to those fields.  But I can't get the form to post HTML content.  The article here
    (http://msdn.microsoft.com/en-us/library/a2a4yykt(v=vs.100).aspx) advises me to turn off the request validation using the @ Page attribute ValidateRequest="false."  However, this has no effect.  Upon form submission, the code behind is
    completely ignored, and the exception  "A potentially dangerous Request.Form value was detected from the client" is logged.
    Is there a way to override this behavior?  I'm using Framework version 4.0 (with Visual Studio 2010).

    If I remember correctly, you *should* be able to use whatever value you want for "key" in the RegisterOnSubmitStatement.  Have you tried something like this just for a test?
    this.ClientScript.RegisterOnSubmitStatement(
    this.GetType(),
    "I_Can_Put_Whatever_I_Want_Here",
    "alert('Microsoft is Awesome!');"
    But I *think* you are having a different issue.  It *sounds* like to me that maybe your EncodeAll ECMA/JavaScript function may not be getting registered properly or in a timely manner.  Have you used IE Developer Tools (F12) to poke around
    and view the available ECMA/JavaScript Files and definitions?
    There are different ways to register ECMA/JavaScript in *.NET.  One primitive way is to simply put something like this in the "head" tag of your MasterPage or ASPX file:
    <script type="text/javascript" src="./myJSFile.js">
    </script>
    Others ways are to use the
    ScriptManager or
    RegisterClientScriptInclude .  You can see a few easy examples of how to register ECMA/JavaScript in Mr. Akhtar's post here:
    https://stackoverflow.com/questions/1666797/how-to-include-javascript-file-in-asp-net-page
    One really *strange* behavior that seems to get a lot of people when registering JavaScript manually via the "script" tag as mentioned above is that you often have to use a *full* </script> end tag for scripts to register properly. 
    I have *no* idea why some browsers require this, but it is something web developers need to be aware of.  For example my
    "<script type='text/javascript' src='./myJSFile.js'></script>"
    example above should work if you have the right path but strangely
    "<script type='text/javascript' src='./myJSFile.js' />" does *not* necessarily work on all browsers even if you do use the correct path to the desired ECMA/JavaScript File.
    Best,
    Shawn

  • How can I make Azure blob give me "206 Partial content" for mp4. Getting 200

    I want a video for my web-site, so I am using html+JavaScript found on view-source:https://www.airbnb.com/ 
    see id="pretzel-video"
    and script starting from   var video = $("#pretzel-video");
    The point is - if I copy html+JavaScript on my web-site, I can get "206 Partial content" from  airbnb.com, i.e. the video hosted on airbnb.com starts streaming immediately. 
    The same thing happens if I upload the same video to my domain hosted on arvixe.com and S3 Amazon
    The only provider that doesn't give me 206, but responds with 200 instead is Azure blob
    This is unacceptable, because the user has to wait until all the video is loaded.
    So how can I make Azure blob give me  "206 Partial content". I am hosting web-site on Azure also. 
    I am using airbnb.com video in all three cases to exclude possible errors related to codek etc.

    Hi Chao 
    Azure Blob storage  supports return 206 response if you're using API version 2011-01-18 or later . 
    However if
    don't originate the request which means you can't specify this using the request header , you can set the API version globally
    for blob service within  a storage account by using " Set
    Blob Service Properties" API , 
    If the above still couldn't solve your issue, we suggest you please contact Microsoft Azure technical support for further assistance.
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    Regards,
    Serena Yu
    Microsoft Online Community Support

  • Http post large images

    Hello people ...
    I've been working on this for almost a week
    am trying to post an image and some text with it to my server
    i know that i can post large images to an ASP.NET page .. but now am dealing with apache 2.2.3 and am using multipart post
    I've tested this code using nokia devices and it is working fine
    but on sony ericsoon devices " z520 and z610" it is giving 502 proxy error response ...
    here is the client and server responses ....
    WHAT IS WRONG WITH SONY ERICSSON DEVICES
    any idea what is happening
    here is my code
    InputStream is = null;
            OutputStream os = null;
            DataInputStream dis = null;
            StringBuffer responseMessage = new StringBuffer();      
            StringBuffer b = new StringBuffer();
            HttpConnection c= null;
            try
                String message1 =  "-----------------------------2789938726602\r\n" +
                        "Content-Disposition: form-data; name=\"post[id]\"\r\n\r\n" +
                        "-----------------------------2789938726602\r\n" +
                        "Content-Disposition: form-data; name=\"post[title]\"\r\n\r\n" +
                        " bahjat\r\n" +
                        "-----------------------------2789938726602\r\n" +
                        "Content-Disposition: form-data; name=\"post[discription]\"\r\n\r\n" +
                        "Description\r\n" +
                        "-----------------------------2789938726602\r\n" +
                        "Content-Disposition: form-data; name=\"post[username]\"\r\n\r\n" +
                        "Username\r\n" +
                        "-----------------------------2789938726602\r\n" +
                        "Content-Disposition: form-data; name=\"post[password]\"\r\n\r\n" +
                        "Password\r\n" +
                        "-----------------------------2789938726602\r\n" +
                        "Content-Disposition: form-data; name=\"post[category_id]\"\r\n\r\n" +
                        "1\r\n" +
                        "-----------------------------2789938726602\r\n" +
                        "Content-Disposition: form-data; name=\"post[file]\"; filename=\"mobile.jpg\"\r\n" +
                        "Content-Type: image/jpeg\r\n\r\n";
                 String message2 ="-----------------------------2789938726602--"; 
                 byte[] Message1 = message1.getBytes();
                 byte[] Message2 = message2.getBytes();
                 int total_length = Message1.length + Message2.length + postByte.length ;
                c = (HttpConnection) Connector.open(URL, Connector.READ_WRITE);
                c.setRequestMethod(HttpConnection.POST);
                c.setRequestProperty("Host","hq.d1g.com")  ;
                c.setRequestProperty("Accept"," text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5");
                c.setRequestProperty("Accept-Charset"," ISO-8859-1,utf-8;q=0.7,*;q=0.7");
                c.setRequestProperty("User-Agent", "Profile/MIDP-2.0 Confirguration/CLDC-1.0");
                c.setRequestProperty("Accept-Encoding", "gzip, deflate");
                c.setRequestProperty("Accept-Language","en-us,en;q=0.5");
                c.setRequestProperty("Http-version","HTTP/1.1");
                c.setRequestProperty("Content-Type", "multipart/form-data;boundary=---------------------------2789938726602");
                c.setRequestProperty("Content-Length", Integer.toString(total_length) ); 
                c.setRequestProperty("Keep-Alive","300");
                c.setRequestProperty("Connection","Keep-Alive");
                os = c.openOutputStream();  
                os.write(Message1);
                os.write(postByte);
                os.write(Message2);          
                os.close();
                Message1 = null;
                Message2 = null;
               int rc = c.getResponseCode();
               if (rc != HttpConnection.HTTP_OK) {
                    b.append("Response Code: " + c.getResponseCode() + "\n");
                    b.append("Response Message: " + c.getResponseMessage() +
                            "\n\n");        
               Resived_String=b.toString();
               is = c.openInputStream() ;
                // retrieve the response from server
               int ch;
               while( ( ch = is.read() ) != -1 )
                    responseMessage.append( (char)ch );
               String s=responseMessage.toString();
               Resived_String+=s;
            catch (Exception ce) {
                Resived_String=ce.getMessage(); }
            finally {
                if(dis != null)
                    dis.close();
                if (is != null)
                    is.close();
                if (os != null)
                    os.close();
            return Resived_String;here is the headers as i followed them using wireshark
    client
    POST /gallery/post/update HTTP/1.1
    Host: hq.d1g.com
    Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
    Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
    User-Agent: Profile/MIDP-2.0 Confirguration/CLDC-1.0
    Accept-Encoding: gzip, deflate
    Accept-Language: en-us,en;q=0.5
    Http-version: HTTP/1.1
    Content-Type: multipart/form-data;boundary=---------------------------2789938726602
    Keep-Alive: 300
    Connection: Keep-Alive
    User-Agent: UNTRUSTED/1.0
    Transfer-Encoding: chunked
    server response
    HTTP/1.1 502 Proxy Error
    Date: Wed, 04 Apr 2007 12:49:40 GMT
    Content-Length: 493
    Connection: close
    Content-Type: text/html; charset=iso-8859-1
    <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
    <html><head>
    <title>502 Proxy Error</title>
    </head><body>
    Proxy Error
    The proxy server received an invalid response from an upstream server.
    The proxy server could not handle the request POST /gallery/post/update.
    Reason: Error reading from remote server
    <hr>
    <address>Apache/2.2.3 (Fedora) Server at hq.d1g.com Port 80</address>
    </body></html>
    and some times i get this response
    404 not found
    so any idea what i can do

    Thank your reply,and I think there are some bad with code,but there is only
    a swc,and I can't analyze the c/c++ code,so I relly don't konw how to solve
    it, Can you provide me some c/c++ code,and I can compile them to Alchemy
    code...
    2009/10/28 zazzo9 <[email protected]>
    It is either a bug with your code or with the library, which may be
    aggravated by a bug in alchemy where it fails to report exhausted memory
    properly.  The library you are using is just a demonstration and may likely
    have bugs.
    >

  • How to get blob image width with ordimage?

    Hello,
    I have trouble getting image width with ordimage. I have quite the same program for processing images as here: http://spendolini.blogspot.com/2005/10/manipulating-images-with-database.html
    so I have declared image files as BLOB files. How can I get the width for the them?
    There is a sample from ordimage reference:
    DECLARE
    image ORDSYS.ORDImage;
    width INTEGER;
    BEGIN
    SELECT p.product_photo INTO image FROM pm.online_media p
    WHERE p.product_id = 3515;
    -- Get the image width:
    width := image.getWidth();
    DBMS_OUTPUT.PUT_LINE('Width is ' || width);
    COMMIT;
    END;
    the ORDSYS.ORDIMAGE is used instead of BLOB here. when i do the same then i can't select BLOB content into the ORDSYS.ORDIMAGE variable. And otherwise I can't use the getWidth with the BLOB variable.
    Can anybody help please?

    Hi,
    the column blob_content is not suitable for storing into v_image2 because variable v_image2 is of type ORDSYS.ORDIMAGE and the column is BLOB.
    I used the following method instead:
    declare
    image blob;
    attributes clob;
    img_mimeType varchar2(32);
    img_width integer;
    img_height integer;
    img_contentLength integer;
    fileFormat varchar2(32);
    contentFormat varchar2(32);
    compressionFormat varchar2(32);
    begin
    DBMS_LOB.CREATETEMPORARY(attributes, TRUE, DBMS_LOB.CALL);
    select img
    into image
    from image_repository
    where id = 0;
    ORDSYS.ORDImage.getProperties(image,
    attributes,
    img_mimeType,
    img_width,
    img_height,
    fileFormat,
    compressionFormat,
    contentFormat,
    img_contentLength);
    dbms_output.put_line(img_mimeType);
    dbms_output.put_line(img_width);
    dbms_output.put_line(img_height);
    dbms_output.put_line(fileFormat);
    dbms_output.put_line(compressionFormat);
    dbms_output.put_line(contentFormat);
    dbms_output.put_line(img_contentLength);
    DBMS_LOB.FREETEMPORARY(attributes);
    end;
    try adapting this code and think about the possibility of "caching" image properties, because it takes some time to retrieve them every time.
    Bye,
    Flavio
    http://oraclequirks.blogspot.com/search/label/Apex

  • Text format + attached image files or Html format + displayed images ?

    Hi, I have this kind of probleme and I need some help.
    (Code : see below)
    I want to send a mail with some attached image files.
    For the message part, I create a MimeBodyPart and add two kinds of message (text or html) and this part is multipart/alternative.
    For the attachment part, I create another MimeBodyPart and I set the Header like this : xxx.setHeader("Content-ID", "<image>").
    When I use outlook (html format) , I receive a mail with the picture displayed at the bottom, it's perfect.
    However the problem is for the mailbox which is in text mode, I receive a mail with message + attachment files, but I also have some image frames generated by xxx.setHeader("Content-ID", "<image>") I guess.
    Who can give me a hand to implement something that able to make difference according to text format or html format.
    I post my code here, thanks a lot :
    //set Message
         msg.setText(pMsgText, DEFAULT_CHARSET);
         // Partie Texte brut
         MimeBodyPart textPart = new MimeBodyPart();
         String header = "";
         textPart.setText(header + pMsgText, DEFAULT_CHARSET);
         textPart.setHeader(
                   "Content-Type",
         "text/plain;charset=\"iso-8859-1\"");
         textPart.setHeader("Content-Transfert-Encoding", "8bit");
         // Partie HTML
         MimeBodyPart htmlPart = new MimeBodyPart();
         String images = BTSBackUtil.generateImgSrc(pictureContainers.length);
         String endPart = "</div>\n</body>\n</html>";
         htmlPart.setText(pMsgTextHTML+images+endPart);
         htmlPart.setHeader("Content-Type", "text/html");
         // create the mail root multipart
         // Multipartie
         Multipart multipart = new MimeMultipart("mixed");
         // create the content miltipart (for text and HTML)
         MimeMultipart mpContent = new MimeMultipart("alternative");
         // create a body part to house the multipart/alternative Part
         MimeBodyPart contentPartRoot = new MimeBodyPart();
         contentPartRoot.setContent(mpContent);
         // add the root body part to the root multipart
         multipart.addBodyPart(contentPartRoot);
         // add text
         mpContent.addBodyPart(textPart);
         // add html
         mpContent.addBodyPart(htmlPart);
         // this part treates attachment
         if (pictureContainers != null){
              PictureContainer pictureContainer = new PictureContainer();
              String fileName = "";
              for(int i = 0; i < pictureContainers.length; i++) {
                   pictureContainer = pictureContainers;
                   byte[] bs = pictureContainer.getImgData();
                   fileName = "image" + i +".jpg";
                   DataSource dataSource = new ByteArrayDataSource(fileName, "image/jpeg", bs);
                   DataHandler dataHandler = new DataHandler(dataSource);
                   MimeBodyPart mbp = new MimeBodyPart();
                   mbp.setDataHandler(dataHandler);
                   mbp.setHeader("Content-ID", "<image"+i+">");
                   mbp.setFileName(fileName);
                   multipart.addBodyPart(mbp);
    // end attachment
    msg.setContent(multipart);

    Hi All!!! I have created this code , i hope this w'll solve u'r problem , this code display u'r html text and display the images below on it, no need to attach the image...... byee.
    package Temp;
    import javax.activation.DataHandler;
    import javax.activation.DataSource;
    import javax.activation.FileDataSource;
    import javax.activation.URLDataSource;
    import javax.mail.Authenticator;
    import javax.mail.BodyPart;
    import javax.mail.Message;
    import javax.mail.MessagingException;
    import javax.mail.PasswordAuthentication;
    import javax.mail.Session;
    import javax.mail.Transport;
    import javax.mail.internet.AddressException;
    import javax.mail.internet.InternetAddress;
    import javax.mail.internet.MimeBodyPart;
    import javax.mail.internet.MimeMessage;
    import javax.mail.internet.MimeMultipart;
    public class HtmlImageExample {
    public static void main (String args[]) throws Exception {
    String host = "smtp.techpepstechnology.com";;
    String from = "[email protected]";
    String to = "[email protected]";
    //String to = "[email protected]";
    String dir=null;
    //String file = "C://NRJ/EmailApp/src/java/MailDao//clouds.jpg"];
    //File file = new File("C:\\NRJ\\EmailApp\\src\\java\\Temp
    Sunset.jpg");
    // Get system properties
    //Properties props = System.getProperties();
    HtmlImageExample html1 = new HtmlImageExample();
    html1.postImage(to,from);
    // Setup mail server
    String SMTP_HOST_NAME = "smtp.techpepstechnology.com";//smtp.genuinepagesonline.com"; //techpepstechnology.com";
    String SMTP_AUTH_USER = "[email protected]"; //[email protected]"; //techpeps";
    String SMTP_AUTH_PWD = "demo"; //techpeps2007";
    //my code
    public void postImage(String to, String from) throws MessagingException, FileNotFoundException, IOException
    Properties props = System.getProperties();
    props.put("mail.transport.protocol", "smtp");
    props.put("mail.smtp.host", SMTP_HOST_NAME);
    props.put("mail.smtp.auth", "true");
    // props.load(new FileInputStream(file));
    Authenticator auth = new SMTPAuthenticator();
    Session session = Session.getInstance(props, auth);
    // Create the message
    Message message = new MimeMessage(session);
    // Fill its headers
    message.setSubject("Embedded Image");
    message.setFrom(new InternetAddress(from));
    message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
    message.setContent
    h1. This is a test
    + "<img src=\"http://www.rgagnon.com/images/jht.gif\">",
    "image/jpeg");
    // Create your new message part
    //BodyPart messageBodyPart = new MimeBodyPart();
    //mycode
    MimeMultipart multipart = new MimeMultipart("related");
    MimeBodyPart mbp1 = new MimeBodyPart();
    // Set the HTML content, be sure it references the attachment
    String htmlText = "<html>"+
    "<head><title></title></head>"+
    "<body>"+
    " see the following jpg : it is a car!
    "+
    h1. hello
    "+
    //"<IMG SRC=\"CID:Sunset\" width=100% height=80%>
    "+
    "<img src=\"http://www.yahoo.com//70x50iltA.gif\">"+
    " end of jpg"+
    "</body>"+
    "</html>";
    mbp1.setContent("h1. Hi! From HtmlJavaMail
    <img src=\"cid:Sunset\">","text/html");
    MimeBodyPart mbp2 = new MimeBodyPart();
    mbp2.setText("This is a Second Part ","html");
    // Fetch the image and associate to part
    //DataSource fds=new URLDataSource(new URL("C://NRJ//MyWeb//logo.gif"));
    FileDataSource fds = new FileDataSource("C://NRJ//MyWeb//Sunset.jpg");
    mbp2.setFileName(fds.getName());
    mbp2.setText("A Wonderful Sunset");
    mbp2.setDataHandler(new DataHandler(fds));
    mbp2.setHeader("Content-ID","<Sunset>");
    // Add part to multi-part
    multipart.addBodyPart(mbp1);
    multipart.addBodyPart(mbp2);
    message.setContent(multipart);
    // Send message
    Transport.send(message);
    //mycode
    private class SMTPAuthenticator extends javax.mail.Authenticator
    public PasswordAuthentication getPasswordAuthentication() {
    String username = SMTP_AUTH_USER;
    String password = SMTP_AUTH_PWD;
    return new PasswordAuthentication(username, password);

  • Problem with displaying BLOB images on JSP page using a servlet

    hi. I have a big problem with displaying BLOB images using JSP. I have a servlet that connects to the oracle database, gets a BLOB image , reads it, and then displays it using a BinaryStream. The problem is , this works only when i directly call that servlet, that is http://localhost:8080/ImageServlet. It doesn't work when i try to use that servlet to display my image on my JSP page (my JSP page displays only a broken-image icon ) I tried several coding approaches with my servlet (used both Blob and BLOB objects), and they work just fine as long as i display images explicitly using only the servlet.
    Here's what i use : ORACLE 10g XE , Eclipse 3.1.2, Tomcat 5.5.16 , JDK 1.5
    here is one of my image servlet's working versions (the essential part of it) :
                   BLOB blob=null;
              rset=st.executeQuery("SELECT * FROM IMAGES WHERE ID=1");
              while (rset.next())
                   blob=((OracleResultSet)rset).getBLOB(2);
              response.reset();
              response.setContentType("image/jpeg");
              response.addHeader("Content-Disposition","filename=42.jpeg");
                    ServletOutputStream ostr=response.getOutputStream();
                   InputStream istr=blob.getBinaryStream(1L);
                    int size=blob.getBufferSize();
              int len=-1;
                    byte[] buff = new byte[size];
                         while ((len=istr.read( buff ))!=-1 ) {
                   ostr.write(buff,0,len);
             response.flushBuffer();
             ostr.close(); and my JSP page code :
    <img src="/ImageServlet" border="0"  > If you could just tell me what i'm doing wrong here , or if you could show me your own solutions to that problem , i would be very greatful ,cos i'm realy stuck here , and i'm rather pressed for time too. Hope someone can help.

    I turns out that it wasn't that big of a problem after all. All i had to do was to take the above code and place it into another JSP page instead of into a servlet like i did before. Then i just used that page as a source for my IMG tag in my first JSP. It works perfectly well. Why this doesn't work for servlets i still don't know, but it's not a problem form me anymore . Ofcourse if someone knows the answer , go ahead and write. I would still appriceatte it.
    here's the magic tag : <img src="ImageJSP.jsp" border="0"  > enjoy : )

  • Report and HTML content

    Hi,
    I have a lot of HTML formatted text stored in a blob field.
    The HTML code has some <b>a href</b> tags (something like this: a href = "53127" or a href = "53127_1" or a href = "53127_2" ...).
    I created a appIication using APEX (10gXE) and I can display the HTML content in my report but the links do not work.
    I need something like this:
    http://127.0.0.1:8080/apex/f?p=103:4:SESSION_ID::NO:RP,:P4_CODACT:53127
    instead of:
    http://127.0.0.1:8080/apex/53127
    I am tryng to migrate a web application created in Java using servlets. In Java the solution was the use of regular expressions to convert the stored <b>a href</b> tag to a valid url.
    Here is my Java code:
    -- some code
            s=processHtmlTags(s,
                "<a href = \"([0-9_].*?)\">",
                "<a href=\"" + dm.response.encodeURL("ResultDetail") + "?codact=",
                "\">");-- rest of servlet
    -- the processHtmlTags definition
        public String processHtmlTags(String INPUT, String REGEX, String strHead, String strTail) {
            int cnt=0;
            String strOutput;       
            Pattern pattern;
            Vector group0 = new Vector(5);
            Vector group1 = new Vector(5);       
            try {
                pattern = java.util.regex.Pattern.compile(REGEX);
                matcher = pattern.matcher(INPUT);
            catch(java.util.regex.PatternSyntaxException pse) {
            while (matcher.find()) {           
                group0.addElement(matcher.group(0));
                group1.addElement(matcher.group(1));
                cnt++;
            strOutput=INPUT;
            for(int i=0; i<group0.size(); i++) {           
                String s0=(String)group0.elementAt(i);
                String s1=(String)group1.elementAt(i);
                strOutput=strOutput.replaceAll(s0,strHead+strAnchor(s1)+strTail);           
            return strOutput;
        }The question is can I do the same thing using APEX?
    Thanks,
    Catalin Florean.

    Use the REGEXP_REPLACE function available in 10g.
    That also implies switching from an HTML region to a PL/SQL region.

  • SSRS 2008 R2 report does not print the page header for a html content displaying on multiple pages

    Hi
    I need to display the html content from the database. The html content are quite long and can have content of 3-5 pages. Issue I  am facing is f the record has html content of 3-5 pages, then it does not print the page header (which is a separate tablix) on
    second page onwards.
    Nikesh Shah
    Nikesh Shah

    Hi Nikesh,
    According to your description, I’m not sure the meaning of Page header in your scenario. In Reporting Services, a page header that run along the top of each page, respectively. Headers can contain static text, images, lines, rectangles, borders, background
    color, background images, and expressions. But we couldn’t add tablix in the page header.
    If you are saying report header, a report header consists of the report items that are placed at the top of the report body on the report design surface. They appear only once as the first content in the report. So it cannot repeat in other pages.
    If you are saying tablix header, freezing column headers are different in table and matrix. For more details, please refer to the following thread:
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/c8ddc1af-1bdf-4e72-8aab-0353c7cc848a/ssrs-report-freezing-row-and-column-while-scrolling-issue?forum=sqlreportingservices
    If there are any misunderstanding, please elaborate the issue for further investigation.
    Regards,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

Maybe you are looking for