Solved

image from url to file

Posted on 2014-02-04
8
299 Views
Last Modified: 2014-02-22
Hi,

I tried below example.

http://www.avajava.com/tutorials/lessons/how-do-i-save-an-image-from-a-url-to-a-file.html

When i run the example I do not see any output. How to fix this issue.

please advise
Any links resources ideas highly appreciated. Thanks in advance
0
Comment
Question by:gudii9
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +1
8 Comments
 
LVL 19

Assisted Solution

by:Ken Butters
Ken Butters earned 125 total points
ID: 39834129
recreated example from your URL
http://www.avajava.com/tutorials/lessons/how-do-i-save-an-image-from-a-url-to-a-file.html

into a test java application

attached screenshot to show where jpg file is created and stored.
2-4-2014-4-36-45-PM.jpg
0
 
LVL 14

Assisted Solution

by:CPColin
CPColin earned 125 total points
ID: 39834131
Judging by the code, nothing is supposed to be printed to the console; the only output is to the image.jpg file. Have you searched around and tried to open that file?
0
 
LVL 7

Author Comment

by:gudii9
ID: 39843258
I do not see image.jpg.

Actully i see now below error

Exception in thread "main" java.net.ConnectException: Connection timed out: connect
      at java.net.PlainSocketImpl.socketConnect(Native Method)
      at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)


I think i need to try from home laptop once i reach home instead. Not sure why Connection Timed out error coming.
SaveFromImg.jpg
0
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 
LVL 19

Expert Comment

by:Ken Butters
ID: 39843286
Could be a firewall issue.

You may be blocked from : http://www.avajava.com/images/avajavalogo.jpg
0
 
LVL 35

Expert Comment

by:mccarl
ID: 39843945
Or possibly a proxy issue, if you can navigate to these sites from your browser ok but your Java apps fail then it is likely that you can only get to the Internet via a proxy. So yes, try from home and see how you go.
0
 
LVL 7

Author Comment

by:gudii9
ID: 39878712
i tried from home laptop. I do not see jpg file being created. please advise
ImgFileJAva.jpg
0
 
LVL 14

Expert Comment

by:CPColin
ID: 39878744
Eclipse probably wouldn't show it immediately. Have you used the Search tool that Windows has to try to find image.jpg?
0
 
LVL 35

Accepted Solution

by:
mccarl earned 250 total points
ID: 39879144
I do not see jpg file being created
Right-click on your Project in Eclipse and select Refresh (or alternatively, select the project and hit F5) and then the file should show up. It will be towards the bottom of the list of files under you project, ie. it would be further down the screen than the part that you show in that screenshot.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question