Link to home
Start Free TrialLog in
Avatar of Denisdh
DenisdhFlag for Ireland

asked on

How can I check the return of objBinaryStream.Write objXMLHTTP.responseBody to see if it's what I want?

Experts,

I have a function that I'm using to download images. I need to edit the URL so I try and get the large verion of the image URL I have. In some cases the largerURL is doesn't exists and I get an XML file returning an error.

Is it possible to check objBinaryStream.Write objXMLHTTP.responseBody to see if it's an image or an xml file?

If so how would I go about it? If not how can I cater for this problem?
SOLUTION
Avatar of RobSampson
RobSampson
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Denisdh

ASKER

Hey,

I've tried the following with no luck. <?xml is in the files that it downloads but this code doesn't seem to catch it.

Any other suggestions?


If InStr(LCase(objXMLHTTP.responseBody), "<?xml") > 0 Then
  Response.Write("XML File Found, no image at this URL")
End If

Open in new window

SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial