I need a java code for downloading files from the internet ..For example I want to download doc,pdf files from the internet means i have to do it through my code ..So can anyone help me
abar_sow
0
Light Poster
Recommended Answers
Jump to PostThis is accomplished with sockets via http. See if this helps:
http://www2.sys-con.com/itsg/virtualcd/Java/archives/0204/dibella/index.html
Jump to PostWow. I'd been wondering about that too...
Thank you abar_sow for asking the question and Ezzaral for answering it.:icon_smile:
Jump to PostYou cannot declare a variable in a while condition, which you are attempting with the "int count" part. Change this to
int count; while( (count = in.read(data,0,1024)) != -1)
instead. Notice the change from != null to != -1 also. The read method returns -1 at the …
All 11 Replies
Ezzaral
2,714
Posting Sage
Team Colleague
Featured Poster
venomlash
55
Junior Poster
abar_sow
0
Light Poster
Ezzaral
2,714
Posting Sage
Team Colleague
Featured Poster
abar_sow
0
Light Poster
abar_sow
0
Light Poster
malin890423
0
Newbie Poster
peter_budo
2,532
Code tags enforcer
Team Colleague
Featured Poster
bs123
0
Newbie Poster
dcholan
0
Newbie Poster
peter_budo
2,532
Code tags enforcer
Team Colleague
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.