Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

image from url to file

Posted on 2014-02-04
8
Medium Priority
?
308 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 500 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 500 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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 1000 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I had a project requirement for a displaying a user workbench .This workbench would consist multiple data grids .In each grid the user will be able to see a large number of data. These data grids should allow the user to 1. Sort 2. Export the …
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
The viewer will learn how to implement Singleton Design Pattern in Java.
Suggested Courses

636 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