CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2010
    Posts
    2

    Exclamation Emulating Save Image As in Web Browser Control

    Hi,

    I've been searching for awhile but i can't find an answer. How do you emulate the save image as in IE in a webbrowser control? I already have the element("src") but i can't figure out how to download it WITH a dialog box.

    Thanks,
    Arjun

  2. #2
    Join Date
    Apr 2009
    Posts
    394

    Re: Emulating Save Image As in Web Browser Control

    Friends time (yahoo, google, ask, answers, bing) vb6 URLDownloadToFile API...

    Okay, you have the source http...jpg/bmp/tga/png/etc then all you need is the common dialog control with the showsave method to collect the destination file name. Once you have that, execute the API...



    Good Luck

  3. #3
    Join Date
    Jul 2010
    Posts
    2

    Re: Emulating Save Image As in Web Browser Control

    Hi, I've toyed around with the api and seem to have gotten it to work, but what I don't understand is how to get the directory path **with** the correct extension. Could you please post some sample code? I would appreciate it if you could.

  4. #4
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Emulating Save Image As in Web Browser Control

    What are you having problems with? The local machine path? use app.path in vb6
    Code:
    msgbox "app.path & \folder"
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  5. #5
    Join Date
    Apr 2009
    Posts
    394

    Re: Emulating Save Image As in Web Browser Control

    Okay, you have the URL to the image right? So, you put that into a string variable...

    MyString = ...

    Then you will need a couple of dynamic arrays declared. One for the CD.FileName and one for the CD.Filter. (Dim E() As String, N() As String)

    Split on the "/" for retrieving the filename, and split on the "." for the extension (use the UBound Function...)...

    Give it a try and if you have problems, post your code.



    Good Luck

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

Featured