How to save the image on the web through java code?

Suppose a picture can be loaded on the browser, and nothing
else. If I want to use a jave code to intercept the picture
and save it into a file, what does the code look like? I know
the URL of the picture. Thanks.

Hi. Running your code, I got the following, with the URL as:
String dir = "http://california.biocars.org/viewFrames2.php?";
String fileName = "r=840190844&fn=/data/pub/kb030129_fp_2_001.img&xsize=512&ysize=512&zoom=1&contrast=2048&xcen=0.5&ycen=0.5&wval=0&jpq=100";
String urlName = dir+fileName;
URL imageURL = new URL(urlName);
So something wrong? This output does not look like anything
of a jpeg file. Thanks.
==================================================
<html>
<head>
<TITLE> View BioCARS Data </TITLE>
<META name='Author' content='Keith Brister'>
<META HTTP-EQUIV="expires" CONTENT="0">
</head>
<body bgcolor=#ccffff>
<form action=/viewFrames2.php method=POST><input type=hidden name=oldZoom value=1><input type=hidden name=xcen value=0.5><input type=hidden name=ycen value=0.5>
<input type=hidden name=theTrip value=0>
<table>
<tr><td valign=top><table>
<tr><td width=128 height=128><a href="/viewFrames2.php?theState=a:7:{s:4:xcen";s:3:"0.5";s:4:"ycen";s:3:"0.5";s:4:"zoom";s:1:"1";s:13:"autoZoomLevel";i:16;s:5:"azcco";i:0;s:8:"contrast";i:2048;s:6:"wvalue";i:0;&theTXYZ="><img ismap border=0 width=128 height=128 src=imageServer2.php?r=159196106&fn=/&xsize=128&ysize=128&zoom=1&contrast=2048&xcen=0.5&ycen=0.5&wval=0&jpq=100&thumbnail=1></a></td></tr><tr><td><input type=text name=seqDir value=""></td></tr><tr><td><input type=text name=fFileName value=""></td></tr></table></td>
<td><table border=1 cellpadding=0 cellspacing=0><tr><td width=512 height=512><a href="/viewFrames2.php?theState=a:7:{s:4:"xcen";s:3:"0.5";s:4:"ycen";s:3:"0.5";s:4:"zoom";s:1:"1";s:13:"autoZoomLevel";i:16;s:5:"azcco";i:0;s:8:"contrast";i:2048;s:6:"wvalue";i:0;}&theXYZ="><img ismap border=0 width=512 height=512 src=imageServer2.php?r=159196106&fn=/&xsize=512&ysize=512&zoom=1&contrast=2048&xcen=0.5&ycen=0.5&wval=0&jpq=100></a></td><td width=8 length=512><a href="/viewFrames2.php?theState=a:7:{s:4:"xcen";s:3:"0.5";s:4:"ycen";s:3:"0.5";s:4:"zoom";s:1:"1";s:13:"autoZoomLevel";i:16;s:5:"azcco";i:0;s:8:"contrast";i:2048;s:6:"wvalue";i:0;}&bMapVal="><img ismap alt='Set Black Value' width=8 length=512 border=0 src=pixselect.php?r=159196106&bVal=2048&wVal=0&minVal=0></a></td>
<td width=8 length=512><a href="/viewFrames2.php?theState=a:7:{s:4:"xcen";s:3:"0.5";s:4:"ycen";s:3:"0.5";s:4:"zoom";s:1:"1";s:13:"autoZoomLevel";i:16;s:5:"azcco";i:0;s:8:"contrast";i:2048;s:6:"wvalue";i:0;}&wMapVal="><img ismap alt='Set White Value' width=8 length=512 border=0 src=pixselect.php?r=159196106&bVal=2048&wVal=0&maxVal=2048></a></td><td valign=top><table><tr><td><input type=submit name=subbieResetXYZ value='Reset Zoom and Center'></td></tr><tr><td><input type=submit name=subbieZoomIn value='Zoom In'> <input type=submit name=subbieZoomOut value='Zoom Out'></td></tr><tr><td><table border=1><tr><td align=right>Auto Zoom and Center:</td><td><input onClick='this.form.submit();' type=radio name=azcco value=0 checked></td></tr>
<tr><td align=right>Center Only:</td><td><input onClick='this.form.submit();' type=radio name=azcco value=1 ></td></tr>
</table></td></tr>

Similar Messages

  • How to find IP allocated to windows OS through java code

    Hi,
    I want to find no of IPs allocated to windows OS through java code. How i can do this.Please give me idea.
    any help will be appricated.
    Thanks in advance
    Ravi Adha

    You can use the InetAddress class in the java.net package to find all the IP addresses of your computer.

  • How to send data to bam data object through java code

    how to send data to bam data object through java code

    I've made a suggestion in other thread: https://forums.oracle.com/thread/2560276
    You can invoke BAM Webservices (Using Oracle BAM Web Services) or use JMS integration using Enterprise Message Sources (http://docs.oracle.com/cd/E17904_01/integration.1111/e10224/bam_ent_msg_sources.htm)
    Regards
    Luis Fernando Heckler

  • How to save an image into the RTF Viewer

    RTF Viewer.
    The current problem that I have with the RTFViewer is that the RTFEditor allows for images to be inserted but on save the images get lost and no information on the images are saved.

    daregazi wrote:
    I have posted my problem before, nobody replied so I ask again if anybody has any solution??
    I want to save an image, which I created before from a physical file and did some bit-level manipulation, into the same or a new (doesn't matter) physical file (say in png format). But I do not know how to do it. I have tried the FileConnection API and OutputStream and then the method write() to write the byte array, rather this does not solve my problem. I need something like corresponding to J2SE ImageIO.write(image,null) function. Any Idea??
    please.....I don't think it's possible in a midlet. You'll have to save the data as a byte[] to a RecordStore and then convert it back again if you want the midlet to redisplay it.

  • How to save an image from an web page?

    Hello everybody!
    I have a problem and I hope someone can help me :).
    I am trying to save/download an image from an web page to my computer. So given an URL which contains the image, I want to save this/write this image to disk. Here is my code:
    import java.net.*;
    import java.io.*;
    public class Test{
        public static void main(String[] args) throws Exception{
            Test test = new Test();
            test.readFile();
        public void readFile() throws Exception{
            InputStream inputStream = new URL("http://www.google.se/images/hp1.gif").openStream();
            InputStreamReader reader = new InputStreamReader(inputStream);
            BufferedReader buffReader = new BufferedReader(reader);
            BufferedWriter bw = new BufferedWriter(new FileWriter("savedImage.gif"));
            int x=0;
            while((x = buffReader.read()) != -1) {
                bw.write(x);
            bw.flush();
    }The code saves the image to disk, but unfortunately the image is distorted. Can anyone help me to solve this problem.
    Thanx in advance
    Best regards
    /TheMan

    thanx guys for your quick answers. I got i to work with the following code
    InputStream inputStream = new URL("http://www.google.se/images/hp1.gif").openStream();
            FileOutputStream fos = new FileOutputStream(new File("savedImage.gif"));
            int x=0;
            while((x = inputStream.read()) != -1) {
                fos.write(x);
            fos.flush();Again, thanx guys!

  • Unable to fetch the headers in the response of a service through java code

    Hi All,
    Im working with the IDE eclipse-jee-galileo-SR2-win32.In my code Im sending the request to a service using ServiceClient.sendReceive() method. The response from the service is an empty text in the soap Body but with a http status:200 OK . The reponse is as below when testing the service directly:
    Response:
    HTTP/1.1 200 OK
    Server: --
    Content-Type : text/xml
    Content-length : 141
    Date : --
    <SOAP-ENV: Envelope xmlns:SOAP-ENV:"http://schemas.xmlsoap.org/soap/envelope">
    <SOAP-Env:Body/>
    </SOAP-ENV : Envelope>
    Please let me know your inputs to fetch the http response from the service using ServiceClient or Options. Any help is greatly appreciated.
    Thanks,
    Vyshnavi

    Hi Vyshnavi,
    This post is probably more appropriate for the Web Services forum on OTN. This forum is intended to help with questions about Oracle Enterprise Pack for Eclipse and the tooling it provides.
    Here's a good reference for working with ServiceClient. It includes a detailed example.
    http://today.java.net/pub/a/today/2006/12/13/invoking-web-services-using-apache-axis2.html#working-with-serviceclient
    If you're still having issues with your client code, try the "Java Technologies for Web Services" forum on OTN...
    Java Technologies for Web Services
    Your post to the Web Services forum should also state whether the issue is specific to the particular service or if you're unable to get any WS clients running in your development environment. Also include a code snippet.
    Kind regards,
    Carlin

  • How we can import image into flash stage through AC3 code

    I want to import images form my directory . I do not know the process of importing image through action script3. What is the process to importing image . Do any body know the idea.

    Have a look at the Loader class. There are examples in the documentation.

  • How Server can read client side SSL certificates through java code?

    My code will be running on server which will be a java class that should read any SSL certificates for the user that is logging in to the application.
    Kindly let me know how it can be achieved ? I have very rare knowldge on Security. how i can read SSL certificates of the client machine.
    Also let me know the possible solutions for above question.

    For my mud written in java, I used TCP/IP for the connections. When a client connects, he gets his own thread. Those threads are held in a vector in a manager class. each tick of the server does a quick run thru the vector and if the current thread/socket its on is null or !isAlive() its remove from the vector(which in turn removes it from getting any more game updates. This removal can be caused by two things. The clients disconnects by accident(kills his game, locks up has an internet connection hiccup, etc.) or he uses the games "quit" method. The quit method calls a method that does any player saving of data, etc then closes the socket, and sets it to null. thus the manager sees this and removes him frm the vecotr list on the next server tick. Seems to work great form a mud and worked really well in a multiplayer applet game I had up for a while.

  • How to check any URL working or not through Java Code

    Hi,
    Is there any way by which i can check whether any particular URL is working or not using JAVA..
    Thanks in advance......
    AJ09

    Especially for POSTs, I would use HTTPClient: [http://hc.apache.org/httpclient-3.x/]
    For simple GETs, you could just create the URL and then see if openStream works.

  • How to access XI_AF_MSG table in Composite Application Framework Java Code

    Hi Experts,
    I've no knowledge about PI. In one of my projects, I need access the XI_AF_MSG table of PI through java code in a composite application.
    How do I access this table? I've searched this forum for this query but the replies say that any SQL editor can be used to access XI_AF_MSG table. But my question is; How do I get the login details of the database? In the first place, how do I access the underlying database layer of PI? Is there any JAR file which can be used to make the connection?
    It would be of great help if any expert on this can give me a detailed reply.
    Thanks a lot in advance.
    Best Regards,
    Nitin

    Hi Nitin,
    The AFW runs on the J2EE Engine, so this table is in the Java Schema of the database and thus not visible in the ABAP stack. I guess you can use any tool your database provider offers for looking at table contents (e.g. SQLPlus).
    Regarding how to access the table please contact you basis administrator they will have access to the tables as they have j2ee_admin login ids and pwds.
    Regards
    joel

  • When I try to same an image under the command 'save as' it will only let me save as file types 'firefox document' or 'all files' and when I try to look at them later they dont work. How can I save an image as the same file type it is on the web site?!

    When I try to save an image under the command 'save as' it will only let me save as file types 'firefox document' or 'all files' and when I try to look at them later they dont work. How can I save an image as the same file type it is on the web site?!
    == This happened ==
    Every time Firefox opened
    == I updated to one of the firefox versions (Not sure which one it was)

    Thanks Alex, but sadly I already tried that. Neither .docx or .xlsx files show up in the content list. They both show as a Chrome HTML document so changing how Firefox addresses those doesn't help since it thinks its the same type of file. I don't think I can manually add files into the "Content Type" left side nav.

  • Save for web&.... the image exceeds the size for ....issue with AI on imac i7

    Hi,
    I just upgraded from using macbook Pro to Imac inte core i7 with 4GB. I use illustrator CS3 for high resolution documents i.e saving a Design for say maybe saving for iphone &ipod skin; a quality jpg that is 1300px(width) by 2000px(height.
    General information
    The issue is I keep getting the pop up with:
    The image exceeds the size Save for Web was designed for. You may experience out of memory erros and slow performance. Are you sure you want to continue?
    I click yes, but get another pop up with:
    Could not complete this operation. The rastarized image exceeded the maximum bounds for save for web.
    And last weekend after NOT being able to save anything I went and bought 16GB memory thinking that this ussue would be solved, but nada.
    I have researched around here and google only to find about scratch disk: went to preferences then to plug-ins and scratch Disks -I seem NOT to get to the bottom of this at all.
    And this morning I was trying to create a pattern Design and could not even get the design on the color swatches as I have done before with macbook pro with 4GB -IT'S NOT FUN, because I am NOT doing it right. Do you care to help me out?
    Thanks a whole bunch in advance
    //VfromB

    Are you including a color profile?  What metadata are you including with it?
    How many pixels (h x v)?
    50 kb is not all that big.  Does your image have a lot of detail in it?  Content can affect final compressed size.
    -Noel

  • How can I save the images to the iPhone anywhere

    Hello  I own Time capsule 3 tb. How can I save the images to the iPhone anywhere in Time capsule
    note i used fileexplorer when Outside the home isee Outside Message " error connection failed with the error operation time out "
    Thanks

    Most Simple Back Up:
    Drag the iPhoto Library from your Pictures Folder to another Disk. This will make a copy on that disk.
    Slightly more complex: Use an app that will do incremental back ups. This is a very good way to work. The first time you run the back up the app will make a complete copy of the Library. Thereafter it will update the back up with the changes you have made. That makes subsequent back ups much faster. Many of these apps also have scheduling capabilities: So set it up and it will do the back up automatically.
    Example of such apps: Chronosync - but there are many others. Search on MacUpdate or the App Store
    If you want to back up the Photos only:
    Export them using the File -> Export command.
    This User Tip
    https://discussions.apple.com/docs/DOC-4921
    has details of the options in the Export dialogue.

  • How do i copy images from the web?

    How do I copy images on the web for use in a powerpoint presentation?

    Drag them to the desktop or control-click them and choose to copy them to the clipboard.
    (61484)

  • How do I download images from Lightroom Mobile through the web interface?

    I am new to Lightroom Mobile. I would like to access the collections I've synced to the cloud and download individual images from my collections via the web interface. I see there is an option to copy the image via the iPad app but I don't see a copy image option via the web interface. I realize you can share entire collections of photos in the web interface but I would like to be able to simply download select photos via the Lightroom mobile web application. When I right click on the image there is no "save as..." option even - only an option to download the entire webpage.
    Any advice?
    Thanks.

    I was looking to do the same thing and spoke to an Adobe online chat staffer. It was a very confusing conversation. I think I eventually got him to understand what I wanted to do, and he seemed to think the answer was "not possible". Not very impressed with the technical support though.

Maybe you are looking for

  • Song is not available in Russian iTunes Store

    Why this song is not available in Russian iTunes Store?  https://itunes.apple.com/us/album/michael-jackson-beat-goes/id550164893

  • Pop up notification with no subject

    I don't understand what happened, i had received two notifications on m'y Q10 that i don't know where it's come from. It begin with "we're so excited to have you...." and an other that i don't Remember. i did not open them for security. I need help.

  • Veritas volume manager needed?

    any one has veritas volume manager for unix systems? can you make me a copy? i'll pay you some money too? i need it for a practice only? my email address is : [email protected] thanks.

  • How do I delete contacts?

    I need to clean up my phone contacts, so I want to know how to delete all contacts stored on my phone. I selected the delete option and chose "all", however all contacts are still there. I really would like to get this sorted out soon. Thanks.

  • Spinning beach ball appears at random for a radom period of time

    Hi, The spinning beach ball seems to appear at random: resizing crops, browsing through the lib, adjusting exposure. The frequency of appearance is pretty annoying. The ball spins for 10 to 60 seconds. Anyone experiencing the same? rgrds rgr