Solved

image from url to file

Posted on 2014-02-04
8
287 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
  • 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
 
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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

708 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now