Why it did not work if URL is for an internet site?

G

Guest

Hello, friends,

In VB6.0, I tested the following code to download binary image files:

Dim objInet As New InetCtlsObjects.Inet
Dim byteData() As Byte ' Data variable

On Error Resume Next
objInet.RequestTimeout = 30
byteData() = objInet.OpenURL(fullURL, icByteArray)

This worked fine if fullURL = "http://localhost/myWeb/getImage.aspx", but
failed if fullURL = "http://www.companyweb.com/getImage.aspx". (I saw header
xml elements in returned data)

Any ideas?

code for getImage.aspx:

<%@ Page Language="C#" Debug="true" %>
<%@ Import Namespace="System.Data"%>
<%@ Import Namespace="System.IO"%>
<% //????
string sBHCFile="test.jpg";
if (sBHCFile.Length>0)
{
string sBHCPath=MapPath("General\\");
string fullName=sBHCPath+sBHCFile;
Response.WriteFile(fullName);
}
%>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top