We help IT Professionals succeed at work.
Get Started

Down Loading images

mgbp asked
Last Modified: 2012-06-21
I am trying to download images using  "Function URLDownloadToFile Lib "urlmon"  When I created VB application it's working fine and I am able to get the information but when I tried to create a DLL and pass the parameters from an ASP it's not downloading the images and as well as it's not showing any error.
 DLL code:(DownloadImages(project)/Download(classname))

Option Explicit

Private Declare Function URLDownloadToFile Lib "urlmon" _
   Alias "URLDownloadToFileA" _
  (ByVal pCaller As Long, _
   ByVal szURL As String, _
   ByVal szFileName As String, _
   ByVal dwReserved As Long, _
   ByVal lpfnCB As Long) As Long
Private Const ERROR_SUCCESS As Long = 0

Public Function DownloadFile(sSourceUrl As String, _
                             sLocalFile As String) As Boolean
   DownloadFile = URLDownloadToFile(0&, _
                                    sSourceUrl, _
                                    sLocalFile, _
                                    0&, _
                                    0&) = ERROR_SUCCESS

Function DownloadFrmURL(URL)

   sSourceUrl = URL
   sLocalFile = "c:\deleteme.jpg"

   If DownloadFile(sSourceUrl, sLocalFile) Then

        DownloadFrmURL = "TRUE"
   End If
End Function

Call from ASP:

Set objCutCID = Server.CreateObject("DownLoadImages.Download")
IsCreated = objCutCID.DownloadFrmURL("https://www.xxxx.org/test.asp?x=1&y=2")

if IsCreated = "TRUE"
   Response.write "create"
    response.write "not created"
end if

Any help will be greatly appriciated

Thank you,

Watch Question
Rounded IT Consultant / Projects manager / Cloud Consultant / IT Planning
This problem has been solved!
Unlock 1 Answer and 4 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE