Capture Web Cam image in APEX and Upload into the Database

Overview
By using a flash object, you should be able to interface with a usb web cam connected to the client machine. Their are a couple of open source ones that I know about, but the one I chose to go with is by Taboca Labs and is called CamCanvas. This is released under the MIT license, and it is at version 0.2, so not very mature - but in saying that it seems to do the trick. The next part is to upload a snapshot into the database - in this particular implementation, it is achieved by taking a snapshot, and putting that data into the canvas object. This is a new HTML5 element, so I am not certain what the IE support would be like. Once you have the image into the canvas, you can then use the provided function convertToDataURL() to convert the image into a Base64 encoded string, which you can then use to convert into to a BLOB. There is however one problem with the Base64 string - APEX has a limitation of 32k for and item value, so can't be submitted by normal means, and a workaround (AJAX) has to be implemented.
Part 1. Capturing the Image from the Flash Object into the Canvas element
Set up the Page
Required Files
Download the tarball of the webcam library from: https://github.com/taboca/CamCanvas-API-/tarball/master
Upload the necessary components to your application. (The flash swf file can be got from one of the samples in the Samples folder. In the root of the tarball, there is actually a swf file, but this seems to be a different file than of what is in the samples - so I just stick with the one from the samples)
Page Body
Create a HTML region, and add the following:
    <div class="container">
       <object  id="iembedflash" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="320" height="240">
            <param name="movie" value="#APP_IMAGES#camcanvas.swf" />
            <param name="quality" value="high" />
          <param name="allowScriptAccess" value="always" />
            <embed  allowScriptAccess="always"  id="embedflash" src="#APP_IMAGES#camcanvas.swf" quality="high" width="320" height="240"
type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" mayscript="true"  />
    </object>
    </div>
<p><a href="javascript:captureToCanvas()">Capture</a></p>
<canvas style="border:1px solid yellow"  id="canvas" width="320" height="240"></canvas>That will create the webcam container, and an empty canvas element for the captured image to go into.
Also, have a hidden unprotected page item to store the Base64 code into - I called mine P2_IMAGE_BASE64
HTML Header and Body Attribute
Add the Page HTML Body Attribute as:
onload="init(320,240)"
JavaScript
Add the following in the Function and Global Variable Declarations for the page (mostly taken out of the samples provided)
//Camera relations functions
var gCtx = null;
var gCanvas = null;
var imageData = null;
var ii=0;
var jj=0;
var c=0;
function init(ww,hh){
     gCanvas = document.getElementById("canvas");
     var w = ww;
     var h = hh;
     gCanvas.style.width = w + "px";
     gCanvas.style.height = h + "px";
     gCanvas.width = w;
     gCanvas.height = h;
     gCtx = gCanvas.getContext("2d");
     gCtx.clearRect(0, 0, w, h);
     imageData = gCtx.getImageData( 0,0,320,240);
function passLine(stringPixels) {
     //a = (intVal >> 24) & 0xff;
     var coll = stringPixels.split("-");
     for(var i=0;i<320;i++) {
          var intVal = parseInt(coll);
          r = (intVal >> 16) & 0xff;
          g = (intVal >> 8) & 0xff;
          b = (intVal ) & 0xff;
          imageData.data[c+0]=r;
          imageData.data[c+1]=g;
          imageData.data[c+2]=b;
          imageData.data[c+3]=255;
          c+=4;
     if(c>=320*240*4) {
          c=0;
          gCtx.putImageData(imageData, 0,0);
function captureToCanvas() {
     flash = document.getElementById("embedflash");
     flash.ccCapture();
     var canvEle = document.getElementById('canvas');
     $s('P2_IMAGE_BASE64', canvEle.toDataURL());//Assumes hidden item name is P2_IMAGE_BASE64
     clob_Submit();//this is a part of part (AJAX submit value to a collection) two
}In the footer region of the page (which is just a loading image to show whilst the data is being submitted to the collection [hidden by default]) :<img src="#IMAGE_PREFIX#processing3.gif" id="AjaxLoading"
style="display:none;position:absolute;left:45%;top:45%;padding:10px;border:2px solid black;background:#FFF;" />If you give it a quick test, you should be able to see the webcam feed and capture it into the canvas element by clicking the capture link, in between the two elements - it might through a JS error since the clob_Submit() function does not exist yet.
*Part 2. Upload the image into the Database*
As mentioned in the overview, the main limitation is that APEX can't submit values larger than 32k, which I hope the APEX development team will be fixing this limitation in a future release, the workaround isn't really good from a maintainability perspective.
In the sample applications, there is one that demonstrates saving values to the database that are over 32k, which uses an AJAX technique: see http://www.oracle.com/technetwork/developer-tools/apex/application-express/packaged-apps-090453.html#LARGE.
*Required Files*
From the sample application, there is a script you need to upload, and reference in your page. So you can either install the sample application I linked to, or grab the script from the demonstration I have provided - its called apex_save_large.js.
*Create a New Page*
Create a page to Post the large value to (I created mine as 1000), and create the following process, with the condition that Request = SAVE. (All this is in the sample application for saving large values).declare
     l_code clob := empty_clob;
begin
     dbms_lob.createtemporary( l_code, false, dbms_lob.SESSION );
     for i in 1..wwv_flow.g_f01.count loop
          dbms_lob.writeappend(l_code,length(wwv_flow.g_f01(i)),wwv_flow.g_f01(i));
     end loop;
     apex_collection.create_or_truncate_collection(p_collection_name => wc_pkg_globals.g_base64_collection);
     apex_collection.add_member(p_collection_name => wc_pkg_globals.g_base64_collection,p_clob001 => l_code);
     htmldb_application.g_unrecoverable_error := TRUE;
end;I also created a package for storing the collection name, which is referred to in the process, for the collection name:create or replace
package
wc_pkg_globals
as
g_base64_collection constant varchar2(40) := 'BASE64_IMAGE';
end wc_pkg_globals;That is all that needs to be done for page 1000. You don't use this for anything else, *so go back to edit the camera page*.
*Modify the Function and Global Variable Declarations* (to be able to submit large values.)
The below again assumes the item that you want to submit has an item name of 'P2_IMAGE_BASE64', the condition of the process on the POST page is request = SAVE, and the post page is page 1000. This has been taken srtaight from the sample application for saving large values.//32K Limit workaround functions
function clob_Submit(){
          $x_Show('AjaxLoading')
          $a_PostClob('P2_IMAGE_BASE64','SAVE','1000',clob_SubmitReturn);
function clob_SubmitReturn(){
          if(p.readyState == 4){
                         $x_Hide('AjaxLoading');
                         $x('P2_IMAGE_BASE64').value = '';
          }else{return false;}
function doSubmit(r){
$x('P2_IMAGE_BASE64').value = ''
     flowSelectAll();
     document.wwv_flow.p_request.value = r;
     document.wwv_flow.submit();
}Also, reference the script that the above code makes use of, in the page header<script type="text/javascript" src="#WORKSPACE_IMAGES#apex_save_large.js"></script>Assuming the script is located in workspace images, and not associated to a specific app. Other wise reference #APP_IMAGES#
*Set up the table to store the images*CREATE TABLE "WC_SNAPSHOT"
"WC_SNAPSHOT_ID" NUMBER NOT NULL ENABLE,
"BINARY" BLOB,
CONSTRAINT "WC_SNAPSHOT_PK" PRIMARY KEY ("WC_SNAPSHOT_ID")
create sequence seq_wc_snapshot start with 1 increment by 1;
CREATE OR REPLACE TRIGGER "BI_WC_SNAPSHOT" BEFORE
INSERT ON WC_SNAPSHOT FOR EACH ROW BEGIN
SELECT seq_wc_snapshot.nextval INTO :NEW.wc_snapshot_id FROM dual;
END;
Then finally, create a page process to save the image:declare
v_image_input CLOB;
v_image_output BLOB;
v_buffer NUMBER := 64;
v_start_index NUMBER := 1;
v_raw_temp raw(64);
begin
--discard the bit of the string we dont need
select substr(clob001, instr(clob001, ',')+1, length(clob001)) into v_image_input
from apex_collections
where collection_name = wc_pkg_globals.g_base64_collection;
dbms_lob.createtemporary(v_image_output, true);
for i in 1..ceil(dbms_lob.getlength(v_image_input)/v_buffer) loop
v_raw_temp := utl_encode.base64_decode(utl_raw.cast_to_raw(dbms_lob.substr(v_image_input, v_buffer, v_start_index)));
dbms_lob.writeappend(v_image_output, utl_raw.length(v_raw_temp),v_raw_temp);
v_start_index := v_start_index + v_buffer;
end loop;
insert into WC_SNAPSHOT (binary) values (v_image_output); commit;
end;Create a save button - add some sort of validation to make sure the hidden item has a value (i.e. image has been captured). Make the above conditional for request = button name so it only runs when you click Save (you probably want to disable this button until the data has been completely submitted to the collection - I haven't done this in the demonstration).
Voila, you should have now be able to capture the image from a webcam. Take a look at the samples from the CamCanvas API for extra effects if you wanted to do something special.
And of course, all the above assumed you want a resolution of 320 x 240 for the image.
Disclaimer: At time of writing, this worked with a logitech something or rather webcam, and is completely untested on IE.
Check out a demo: http://apex.oracle.com/pls/apex/f?p=trents_demos:webcam_i (my image is a bit blocky, but i think its just my webcam. I've seen others that are much more crisp using this) Also, just be sure to wait for the progress bar to dissappear before clicking Save.
Feedback welcomed.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Hmm, maybe for some reason you aren't getting the base64 version of the saved image? Is the collection getting the full base64 string? Seems like its not getting any if its no data found.
The javascript console is your friend.
Also, in the example i used an extra page, from what one of the examples on apex packages apps had. But since then, I found this post by Carl: http://carlback.blogspot.com/2008/04/new-stuff-4-over-head-with-clob.html - I would use this technique for submitting the clob, over what I have done - as its less hacky. Just sayin.

Similar Messages

  • Get the data  from excel and insert into the database

    I want to read the data from excel file, get the data from excel and insert into the database.

    You can use the Apache POI HSSF API to read data from Excel files and you can use the Sun JDBC API to insert data in database.
    This has nothing to do with JSP/JSTL.

  • How to insert the Formatted date value and insert into the database

    Hi All,
    I am having requirement of inserting the date value in to the datbase. I'm already getting the value from file as MM-DD-YYYY. Getting exception while transforming the values through the transform activity. I'm using format fate function but it is inserting null value in to the database.
    Any help from anyone would bve appreciated.
    Thanks,
    CH

    Hi,
    your input date format is fixed right? So, in the transform you can split each your date, which is in 'MM-DD-YYYY' format ... extract day, month, year.
    After that ... just put these values in order acording to the format of 'xsd:date' data type which is '[-]CCYY-MM-DDZ'.
    XPath function 'xp20:format-dateTime()' works only with 'xsd:dateTime' data type, which has format '[-]CCYY-MM-DDThh:mm:ssZ'.
    So, in your case it could be:
    <xsl:variable name="day" select="substring($inputDate,4,2)"/>
    <xsl:variable name="month" select="substring($inputDate,1,2)"/>
    <xsl:variable name="day" select="substring($inputDate,7,4)"/>
    <xsl:variable name="outputDate">
    <xsl:value-of select="$year"/>
    <xsl:text>-</xsl:text>
    <xsl:value-of select="$month"/>
    <xsl:text>-</xsl:text>
    <xsl:value-of select="$day"/>
    </xsl:variable>
    Regards,
    Martin.

  • Satellite S70-A-11H web camera image quality is not good

    Hi,
    Running windows 8.1 which came with the laptop.
    New out of the box.
    As per title.
    I find the image quality of the camera image to be very grainy, poor color etc.
    When I start the web camera using the search bar on the right, it starts using the Microsoft application, when you scroll down to settings all that is available under settings/options is Photo aspect ratio, Grid lines, Location info.
    I have been in touch with Toshiba Tech support who advised to do a Laptop refresh, which I did.
    This made no difference.
    After which they asked me to find the Toshiba web camera application on the laptop, this should have been in the Program Files folder in the Toshiba folder.
    This application does not exist on my laptop.
    The tech checked the same model laptop that he had available, which I was told when he selected the web camera, it opened using the Toshiba Web camera application, not Microsoft.
    I have looked at other Toshiba laptops with web cameras, and found the image quality to be better. Unable to get to settings as these laptops were on display and in demo mode, hence locked down to some extent.
    I can't believe that a web camera in this day and age for this value of laptop to have such poor image quality. My digital camera from 10year ago has better image quality.
    I have checked through the laptop, and I do not have this application installed.
    I have checked for updated drivers and software for my laptop, and cannot find this application to be applicable for my laptop. Drivers etc appear to be up to date.
    I would like to know, do other users of this S series have any issue of camera image quality.
    When the camera is selected what application is being used, Toshiba or Microsoft.
    Is Toshiba web camera application applicable to Windows 8.1, as I cannot see it listed for 8.1
    Does this sound like a hardware fault or a application/software issue.
    Any direction or help on this matter would be appreciated, as I am getting to the point of returning this laptop for a refund.
    Thanks in advance.
    D.
    Yes, I have tried using the FORCE!

    > The tech checked the same model laptop that he had available, which I was told when he selected the web camera, it opened using the Toshiba Web camera application, not Microsoft.
    The Toshiba webcam application is available for Win 7 system but the Win 8 and Windows 8.1 system use the own Microsoft webcam application.
    > I have looked at other Toshiba laptops with web cameras, and found the image quality to be better.
    Different Toshiba notebooks are equipped with different webcams.
    Satellite S70-A-11H was equipped with a *0.92 mega pixel webcam*
    A Satellite A660 for example was equipped with an _1.3M mega pixel webcam_
    So there is a difference in webcam resolution

  • HT1941 why i cannot use my web cam using yahoo messenger and face time?

    whi i cannot use my web cam using yahoo messenger and face time?

    PwmBoat,
    This made me smile, because things like this do make me smile...  I never make videos on YouCam, but I did this time, so I could test this one out.
    You did not say what webcam software you are using...
    ======================================================================
     Video and audio recording works on YouCam V3.5.1.4606
    Make sure you have turned on a working microphone in Settings:
    YouCam > Right-Side   Settings >
    Right-Side, Lower-Right, Select a working Microphone from the Drop down list
    AND
    CHECK "Capture with audio"
    OK
    You can also buy (for $38 US) YouCam 5.0 from the Cyberlink.com website and it has audio/video and all sorts of other goodies, too.  (They have 3.x as well, but why buy what HP already gives you?)
    ==========================================================================
    I hope this helps!                                 
    We work hard to help!
    Whenever you see a Helpful Post - Click the Kudos Star on the Left as Thanks!
    Did this Post solve your problem?  Mark it “Accept as Solution”!
    Note: You can find the “Accept as Solution” box on threads started by you.
    2012 Year of the Dragon!
    Kind Regards,
    Dragon-Fur

  • Used ipad camera connector to try and upload photos

    Used ipad camera connector to try and upload photos - last worked in Nov 2012. Tried today and no success, did not even recognise camera attached as it normally does, any thoughts on what may be wrong ?

    What browser are you using?

  • HT1414 hello..i have purchaes iphone 5 from u.s it's a factory unlocked iphone 5 ..on may14th..it has warranty till may14th of 2014..and i came undia on july and after using the phone for imonth in india whaen i;m restoring th iphone 5 it doesn't restore

    hello..i have purchaes iphone 5 from u.s it's a factory unlocked iphone 5 ..on may14th..it has warranty till may14th of 2014..and i came idia on july and after using the phone for 1moh in india ,when i'm trying to restore it doesn't shows apple iphone menu..it displays the screen image of connect usb cable to restore itunes .and i tried  times and it shows the error (-1)..when i have contacted apple the said bring the phone to us we will replace it with new one....now i can't go to u.s so please kindly help me..as soon as possible...please

    EDIT 2: It cannot be restored via iTunes 'cause I get a screen message saying that there's no SIM card in the iPhone I'm attempting to activate. The friend who sold me the phone showed me a method for restoring it on the phone itself, without having to send the command through iTunes (connect the phone to computer, turn it off, hold both Home and Power buttons until the Apple logo disappears, release the Power button without releasing Home button, iTunes shows a message about an iPhone in restoring mode, restore, etc.). Thing is, I tried this two or three times on the iPhone 5 but the device still doesn't recognize the stupid SIM…
    Please, help

  • How can one  read a Excel File and Upload into Table using Pl/SQL Code.

    How can one read a Excel File and Upload into Table using Pl/SQL Code.
    1. Excel File is on My PC.
    2. And I want to write a Stored Procedure or Package to do that.
    3. DataBase is on Other Server. Client-Server Environment.
    4. I am Using Toad or PlSql developer tool.

    If you would like to create a package/procedure in order to solve this problem consider using the UTL_FILE in built package, here are a few steps to get you going:
    1. Get your DBA to create directory object in oracle using the following command:
    create directory TEST_DIR as ‘directory_path’;
    Note: This directory is on the server.
    2. Grant read,write on directory directory_object_name to username;
    You can find out the directory_object_name value from dba_directories view if you are using the system user account.
    3. Logon as the user as mentioned above.
    Sample code read plain text file code, you can modify this code to suit your need (i.e. read a csv file)
    function getData(p_filename in varchar2,
    p_filepath in varchar2
    ) RETURN VARCHAR2 is
    input_file utl_file.file_type;
    --declare a buffer to read text data
    input_buffer varchar2(4000);
    begin
    --using the UTL_FILE in built package
    input_file := utl_file.fopen(p_filepath, p_filename, 'R');
    utl_file.get_line(input_file, input_buffer);
    --debug
    --dbms_output.put_line(input_buffer);
    utl_file.fclose(input_file);
    --return data
    return input_buffer;
    end;
    Hope this helps.

  • When I have finished working on an image in Photoshop and I hit the save button it goes instead to the "save as" screen. This never happened in previous Photoshop versions. When I get to Lightroom, I have a grey screen the says "File could not be found."

    When I have finished working on an image in Photoshop and I hit the "save" button, it goes instead to the "save as" screen. This never happened in previous Photoshop versions. When I get to Lightroom, I have a grey screen the says "File could not be found." I then have to go to "locate" to get the image. When I select the correct image, I get a message that it is not the same file name but I am eventually able to access the image. Needless to say this is having a negative impact on workflow!

    The problem with write permissions for the OneDrive folder only shows up in Lightroom 6's export dialogue, that's why it's to irritating. Lightroom 5.7.1 is not having that problem nor does the file explorer. The problem also exists on both of my machines. I will try to check for other problems with the OneDrive troubleshooter though: Running the OneDrive troubleshooter - Windows Help   

  • WEBUTIL_PG.WRITE_DATA( ) and uploading documents into the database

    When we run our Forms application through Forms Builder, with the user account utilized by our actual users, we're able to upload a file into the database using webutil. This particular database user account is restricted to only the tables and packages it needs access to, granting the full SELECT, INSERT, UPDATE, DELETE to the tables, and then EXECUTE on the packages.
    However, when our Developers use their personal database accounts, which essentially have SELECT ANY .. EXECUTE ANY ... etc, this upload process is halted within webutil.pll when it calls the database PACKAGE procedure WEBUTIL_PG.WRITE_DATA( ). It just hangs on that step.
    When you look in OEM, during that hang the graph is showing high levels of "Network" activity. Just a solid plateau. We can't figure out why the difference between these accounts has an effect. Does someone see a pattern here that we're missing?
    Thanks,
    --=Chuck

    "Still sounds like a permissions issue to me." I know right?
    So I logged in as myself. I have DBA privileges in the database. The call to the database package hung for me as well. No error ... just a hung cursor.
    As for debugging ... the call to WEBUTIL_PG hangs, when the Forms code gets to that point in the webutil.pll. So we never even get to the database.
    Our next step, is to try to recreate the process solely in PL/SQL without webutil.pll, but the code in there is pretty extensive, and teasing out only the pieces we'll need is pretty tricky.

  • Problem in Retrieve Image from DB and display in the JSP page

    Hi All,
    I did one JSP Program for retriveing image from DB and display in the JSP Page. But when i run this i m getting "String Value" output. Here i have given my Program and the output. Please any one help to this issue.
    Database Used : MS Access
    DSN Name : image
    Table Name: image
    Image Format: bmp
    Output : 1973956
    Sample Program:_
    <%@ page contentType="text/html;charset=windows-1252"%>
    <%@ page import="java.io.*" %>
    <%
         try{
              Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
              Connection conn = DriverManager.getConnection("jdbc:odbc:image");
              Statement st = conn.createStatement();
              ResultSet rs = st.executeQuery("SELECT images FROM image");
              String imgLen="";
              if(rs.next()){
                   imgLen = rs.getString(1);
                   out.println(imgLen.length());
              if(rs.next()){
                   int len = imgLen.length();
                   byte [] rb = new byte[len];
                   InputStream readImg = rs.getBinaryStream(1);
                   int index=readImg.read(rb, 0, len);
                   System.out.println("index"+index);
                   st.close();
                   response.reset();
                   response.setContentType("image/jpg");
                   response.getOutputStream().write(rb,0,len);
                   response.getOutputStream().flush();
         }catch(Exception ee){
              out.println(ee);
    %>
    Thanks,
    Senthilkumar S

    vishruta wrote:
    <%
    %>Using scriptlets is asking for trouble. Java code belongs in Java classes. Use a Servlet.
                   out.println(imgLen.length());Your JSP was supposed to write an image to the output and you wrote some irrelevant strings to the output before? This will corrupt the image. It's like opening the image in a text editor and adding some characters before to it.
                   byte [] rb = new byte[len];Memory hogging. Don't do that.
              out.println(ee);You should be throwing exceptions and at least printing its trace, not sending its toString() to the output.
    You may find this article useful to get an idea how this kind of stuff ought to work: [http://balusc.blogspot.com/2007/04/imageservlet.html].

  • Is there a software that will allow DVD video to put inserted into computer and uploaded into Mac iMovie?

    Is there a software that will allow DVD video to put inserted into computer and uploaded into iMovie on my MacBook Pro?

    Check out this user tip and see if it helps.
    https://discussions.apple.com/docs/DOC-3951

  • I am encountering crashes with Photoshop Elements 12.  If I uninstall and then reinstall the software, will I jeopardize the 100s of photo images I have already moved into the Organizer?  Any cautions for me

    I am encountering crashes with Photoshop Elements 12.  If I uninstall and then reinstall the software, will I jeopardize the 100s of photo images I have already moved into the Organizer?  Any cautions for me?

    If the app is designed correctly, the no, you won't. However, you'd have to ask the people who wrote the software, Adobe.

  • HT4859 I updated my iPhone 4 to 0sx6 and uploaded to the cloud.  Now all my contacts have been lost.  What to do?

    I updated my iPhone 4 to OSX6 and uploaded to the cloud.  Now all my contacts are lost.  What to do?

    Did you already try to reset the phone by holding the sleep and home button for about 10sec, until the Apple logo comes back again? You will not lose data by resetting.
    If this does not help, set it up as new device:
    How to back up your data and set up as a new device

  • How do I share files uploaded into the Creative Cloud with other creative cloud members?

    How do I share files uploaded into the Creative Cloud with other creative cloud members?

    Should be easy.  Try this...
    In Thumbnails view, click the little triangle (pointing downward) in the lower-right corner of the asset you want to share.
    In the blue icon bar that appears, click the Share icon (the third icon from the left, just right of the trash icon). The Share dialog should pop up.
    In the Share dialog, enter the email address of the person with whom you want to share the asset, then click the Send Email button - they'll receive an email with a link to your asset. OR
    You can also copy a link to the asset and then paste that into your own email client if you prefer.  To do that, click the Link icon (looks like a "chain", and is to the right of the email "envelope" icon) - then click the Copy Link button.
    Note that the Share options won't be available if your asset is set to "Private" - you can control whether an asset can be viewed (or downloaded) by others by clicking the Public/Private control (green or red "lock" icon).
    You can also access the same Share controls if you click on the file to see it one-up (you can do this from either Thumbnails view or List view); click the Share icon near the upper right corner of the browser window (to the right of the asset name).
    Hope that helps.

Maybe you are looking for