Try OpenEdge Now
skip to main content
WebClient Applications
Developing the Application : Using URLs in PROPATH for image file downloads : Handling errors : Authentication errors
 
Authentication errors
If an application uses SEARCH or LOAD-IMAGE( ), the PROPATH contains a URL, and authentication on a Web server fails, the following processing occurs:
*When the URL is not a fully qualified path, SEARCH and LOAD-IMAGE( ) do not raise an error and searching continues with the next entry in the PROPATH.
*When the URL is a fully qualified path:
*The SEARCH function does not raise an error but returns the Unknown value (?).
*The LOAD-IMAGE( ), LOAD-IMAGE-DOWN( ), LOAD-IMAGE-UP( ), LOAD-IMAGE-INSENSITIVE( ), and LOAD-ICON( ) methods all raise error 9368, where server-name is the host name of the Web server, as shown:
Unable to download file from the web. Authentication failed for server server-name.
*You can trap this error, request a user ID and password, and try to download the image again, as in the following example:
DEFINE BUTTON Button1.
Button1:LOAD-IMAGE
  ("http://userid:password@www.progress.com/myimage.jpg") NO-ERROR.
IF ERROR-STATUS:GET-NUMBER(1) = 9368 THEN DO:
  /* Display dialog. */
  /* Update URL string. */
  /* Retry load-image. */
END.