Results 1 to 16 of 16

Thread: Download picture to database

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2006
    Posts
    352

    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

  2. #2
    "Digital Revolution"
    Join Date
    Mar 2005
    Posts
    4,471

    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.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2006
    Posts
    352

    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

  4. #4
    "Digital Revolution"
    Join Date
    Mar 2005
    Posts
    4,471

    Re: Download picture to database

    I don't understand, can you give an example?

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2006
    Posts
    352

    Re: Download picture to database

    Quote 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 ?

  6. #6
    PowerPoster jcis's Avatar
    Join Date
    Jan 2003
    Location
    Argentina
    Posts
    4,430

    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.

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2006
    Posts
    352

    Re: Download picture to database

    Hi, jcis thanks for your contribution can you tell how I would do that using your approach ? thanks

  8. #8
    PowerPoster jcis's Avatar
    Join Date
    Jan 2003
    Location
    Argentina
    Posts
    4,430

    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).

  9. #9
    Hyperactive Member
    Join Date
    Jun 2006
    Posts
    272

    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.

  10. #10
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    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.

  11. #11
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    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.

  12. #12

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2006
    Posts
    352

    Re: Download picture to database

    Quote 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

  13. #13
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    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?

  14. #14

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2006
    Posts
    352

    Re: Download picture to database

    Yes, I intend to display it on a site.

  15. #15
    Hyperactive Member
    Join Date
    Jun 2006
    Posts
    272

    Re: Download picture to database

    do you want to get the url of the pictures from http://www.camadverts.com and store the urls in database?
    DONT RUN EXECUTABLE FILES FROM UNKNOWN SOURCES.

  16. #16

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2006
    Posts
    352

    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
  •  



Click Here to Expand Forum to Full Width