Solved

image from url to file

Posted on 2014-02-04
8
300 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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
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 36

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 36

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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
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 about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

726 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