473,322 Members | 1,493 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Download from web

I have made an application that downloads images from a website with
code like this:

Dim Client As WebClient = New WebClient()
imageUrl = http://www.websíte.com/image.jpg
Client.DownloadFile(imageUrl, dest)

This works fine but the website returns a defaultimage if the image is
adressed with a complete url. You have to first wisit the mainpage and
then you can adress the image.
How can I achive this?


Apr 1 '06 #1
5 1048
Peter,

It is not impossible that the image is protected in a database.

Be aware that you are hacking when you try to get protected data from a
webserver.
At least in my country is there a penalty for that.

Cor

"Peter Eriksson" <pe****************@telia.com> schreef in bericht
news:O2**************@TK2MSFTNGP14.phx.gbl...
I have made an application that downloads images from a website with
code like this:

Dim Client As WebClient = New WebClient()
imageUrl = http://www.websíte.com/image.jpg
Client.DownloadFile(imageUrl, dest)

This works fine but the website returns a defaultimage if the image is
adressed with a complete url. You have to first wisit the mainpage and
then you can adress the image.
How can I achive this?

Apr 1 '06 #2
No, I don't think it is hacking.
It is a public page. You can easily download
the pictures with rightclick in the browser.
It was just a testproject to learn about the WebClient class.
"Cor Ligthert [MVP]" <no************@planet.nl> skrev i meddelandet
news:%2****************@TK2MSFTNGP12.phx.gbl...
Peter,

It is not impossible that the image is protected in a database.

Be aware that you are hacking when you try to get protected data from a
webserver.
At least in my country is there a penalty for that.

Cor

"Peter Eriksson" <pe****************@telia.com> schreef in bericht
news:O2**************@TK2MSFTNGP14.phx.gbl...
I have made an application that downloads images from a website with
code like this:

Dim Client As WebClient = New WebClient()
imageUrl = http://www.websíte.com/image.jpg
Client.DownloadFile(imageUrl, dest)

This works fine but the website returns a defaultimage if the image is
adressed with a complete url. You have to first wisit the mainpage and
then you can adress the image.
How can I achive this?


Apr 2 '06 #3
On Sat, 1 Apr 2006 13:47:07 +0200, "Peter Eriksson"
<pe****************@telia.com> wrote:
I have made an application that downloads images from a website with
code like this:

Dim Client As WebClient = New WebClient()
imageUrl = http://www.websíte.com/image.jpg
Client.DownloadFile(imageUrl, dest)

This works fine but the website returns a defaultimage if the image is
adressed with a complete url. You have to first wisit the mainpage and
then you can adress the image.
How can I achive this?

On the mainpage, right-click the image, properties, and see what the
actual URL is to the image. That URL should retrive the correct image
if the image is static, or, it's an image that is updated periodically
but has an static file name of something like .. /latest.jpg. If it's
an updating image and has an ultimate filename that is based on
something like date/time, you will have to predetermine the current
URL (i.e. a parseHTML routine of some sort)

If VB2005 and you just want to write to disk, you can also use this
with it's various arguments:
My.Computer.Network.DownloadFile(someURL, someDest)
Gene
Apr 3 '06 #4
On Sun, 2 Apr 2006 22:20:14 +0200, "Peter Eriksson"
<pe****************@telia.com> wrote:
No, I don't think it is hacking.
It is a public page. You can easily download
the pictures with rightclick in the browser.
It was just a testproject to learn about the WebClient class.
"Cor Ligthert [MVP]" <no************@planet.nl> skrev i meddelandet
news:%2****************@TK2MSFTNGP12.phx.gbl...
Peter,

It is not impossible that the image is protected in a database.

Be aware that you are hacking when you try to get protected data from a
webserver.
At least in my country is there a penalty for that.

Cor

If simply downloading for personal use, via browser or app, there is
no problem. However, if in an application that ultimately downloads
and displays images form a website and the app is to be distributed,
it's best to check the website(s) to see if there is any copyright
restrictions or premissions required.

Gene
Apr 3 '06 #5
Peter Eriksson wrote:
I have made an application that downloads images from a website with
code like this:

Dim Client As WebClient = New WebClient()
imageUrl = http://www.websíte.com/image.jpg
Client.DownloadFile(imageUrl, dest)

This works fine but the website returns a defaultimage if the image is
adressed with a complete url. You have to first wisit the mainpage and
then you can adress the image.
How can I achive this?


Might it be that the web site checks the referer (sic) property when serving
images in order to prevent what you're trying to do? (Although I don't know
if referer would be set by making a request through .NET.) If you try it on
a web server that you control, does it work as desired first time? You can
also look at the logs for clues.

Just because a URL ends in .jpg doesn't mean that it came directly from the
file - there could be a filter inbetween.

Andrew
Apr 3 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: chon | last post by:
I have an ASP page that is sent a file location as a parameter. It opens this file, loads the ADODB.Stream object and does a binary write to the page forcing the download dialog to appear. This...
0
by: jmd | last post by:
Hello. I want to write a C# program that does completely automatically what, until now, I do manually, witch is describe below : 1. I launch IE (6) 2. I browse to my desired download page, say...
0
by: Buddy Ackerman | last post by:
I am trying to implment a file download via a link such that when clicked, instead of starting the default application for that type of file the user will be presented with a download dialog...
3
by: Nathan Sokalski | last post by:
I have a webform that contains a button which I want to do three things: 1. Delete a record from a database 2. Let the user download a text file that is generated 3. Refresh the page to show...
18
by: jmd | last post by:
Hello, I posted the following in the C# forum but without one answer. But perhaps now in vb.net someone has some guidelines ! This is my question : I want to write a vb.net program that does...
1
by: a.r.austin | last post by:
Hello, I am trying to download a few files one after another from a remote server. Problem is that I don't know how to, or if I am able at all, set a time out for download. I don't want to time...
16
by: matt | last post by:
I have used some free code for listing files for download, but I want to send an email to the administrator when the file has been downloaded. I have got some code in here that does it, but it will...
1
by: JayLembeck | last post by:
Over 50,000 Free Ringtone. Get the Latest Ringtone. Download now- Fast, Free and Easy. Get your FREE surprise RINGTONE now! http://seekoutfast.info/free-ringtone/ free ringtone free ringtone new...
5
by: Khafancoder | last post by:
Hi guys, i am building a FileSharing website, i wanna allow users to be able using download managers such as DAP to download files from webserver but don't allow them to retrive files url......
1
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Many websites have a form or a link you can use to download a file. You click a form button or click...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.