I intend to download pictures from some stored url's in a databse to the very database. Can anyone tell me how I can get around with this ? Thanks
Printable View
I intend to download pictures from some stored url's in a databse to the very database. Can anyone tell me how I can get around with this ? Thanks
Do a search for URLDownloadToFile
But I would personally not store it in a database but write the path to the file in the database.
Hi, and thanks for the quick response and advise, what I am up to is that I dont want to use these pictures without the user getting to know their urls. Any other way around that ? Thanks
I don't understand, can you give an example?
Hi, lets say I'm interested in getting the following links to a Database e.g http://www.camadverts.com/image01.jpg, http://www.camadverts.com/image02.jpg, and http://www.camadverts.com/image03.jpgQuote:
Originally Posted by DigiRev
I want them in a database, so that I can use them as
http://www.vomak.com/image01.jpg,
http://www.vomak.com/image02.jpg, and
http://www.vomak.com/image03.jpg etc.
instead of the above .
can I ?
Are you sure you need to store images in a db? you example looks like:
- download images from somewhere..
- Upload those images to your site via FTP and use them.
Hi, jcis thanks for your contribution can you tell how I would do that using your approach ? thanks
As Digirev said, you can download using URLDownloadToFile API, and about FTP there are more than 1 method and many wrappers, you'll find many examples about URLDownloadToFile and ftp by searching the Forum: in Visual Basic 6 and Earlier Screen go to "Search this Forum" link (Top - Right).
Dont forget to use this. It will clear the cache and refresh the image everytime.
Code:Private Declare Function DeleteUrlCacheEntry Lib "wininet.dll" Alias "DeleteUrlCacheEntryA" (ByVal lpszUrlName As String) As Long
DeleteUrlCacheEntry "YOURURL"
You can still store their paths in the database rather than the images.
Just because the actual path is stored doesn't mean the actual path needs to be displayed in order to get the image.
VB6 also has a built-in wrapper for UrlMon, AsyncRead Method.
I've attached a demo that uses it to retrieve some simple web service data.
I think this is what I am after, I would be glad to get to know how I can get that done. ThanksQuote:
Originally Posted by Hack
I'm sure you know how to store the path (which, after all, is really nothing more than a string).
Once you retrieve the path just tack it on with the image name and display it. None of this has to be visible to the user.
I've reread the posts in this thread to ensure I wasn't going to ask a question already answered.
My question would be once you have the image, what are you going to do with it? Just display it somewhere?
Yes, I intend to display it on a site.
do you want to get the url of the pictures from http://www.camadverts.com and store the urls in database?
Yes and how to get them shown on a different site without the url htt://www.camadverts.com beeing shown.