|
-
May 11th, 2008, 12:37 PM
#1
Thread Starter
Hyperactive Member
Download picture to database
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
-
May 11th, 2008, 12:40 PM
#2
Re: Download picture to database
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.
-
May 11th, 2008, 12:44 PM
#3
Thread Starter
Hyperactive Member
Re: Download picture to 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
-
May 11th, 2008, 01:15 PM
#4
Re: Download picture to database
I don't understand, can you give an example?
-
May 11th, 2008, 01:30 PM
#5
Thread Starter
Hyperactive Member
Re: Download picture to database
 Originally Posted by DigiRev
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, 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.jpg
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 ?
-
May 11th, 2008, 02:34 PM
#6
Re: Download picture to database
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.
-
May 11th, 2008, 02:44 PM
#7
Thread Starter
Hyperactive Member
Re: Download picture to database
Hi, jcis thanks for your contribution can you tell how I would do that using your approach ? thanks
-
May 11th, 2008, 02:52 PM
#8
Re: Download picture to database
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).
-
May 12th, 2008, 08:06 AM
#9
Hyperactive Member
Re: Download picture to database
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"
DONT RUN EXECUTABLE FILES FROM UNKNOWN SOURCES.

-
May 12th, 2008, 09:35 AM
#10
Re: Download picture to database
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.
-
May 12th, 2008, 03:37 PM
#11
Re: Download picture to database
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.
Last edited by dilettante; May 12th, 2008 at 03:44 PM.
-
May 13th, 2008, 08:49 AM
#12
Thread Starter
Hyperactive Member
Re: Download picture to database
 Originally Posted by Hack
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 images.
I think this is what I am after, I would be glad to get to know how I can get that done. Thanks
-
May 13th, 2008, 08:59 AM
#13
Re: Download picture to database
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?
-
May 13th, 2008, 11:25 AM
#14
Thread Starter
Hyperactive Member
Re: Download picture to database
Yes, I intend to display it on a site.
-
May 13th, 2008, 11:55 AM
#15
Hyperactive Member
-
May 13th, 2008, 12:03 PM
#16
Thread Starter
Hyperactive Member
Re: Download picture to database
Yes and how to get them shown on a different site without the url htt://www.camadverts.com beeing shown.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|