473,651 Members | 3,093 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How Can I Display an Image from Another Site?

Hi,
This works:

banner = getImage(GetCod eBase(),"mypict ure.jpg")
But, I tried variations of:

try {
url = new URL("http://www.my-other-website.com/mypicture.jpg") ;
} catch (Exception e){}

banner = getImage(url);

And couldn't get that to work.
Can someone tell me how to display an image from a website other than the
one the applet is on?
Thanks very much,
- Jeff
www.bikewebsite.com

Jul 17 '05 #1
3 2309
On Wed, 29 Sep 2004 03:23:52 +0000, Jeff Napier wrote:
This works:
banner = getImage(GetCod eBase(),"mypict ure.jpg")
But, I tried variations of:

try {
url = new URL("http://www.my-other-website.com/mypicture.jpg") ;
} catch (Exception e){}

banner = getImage(url);

And couldn't get that to work.
Can someone tell me how to display an image from a website other than the
one the applet is on?


I could be wrong, but I thought the default security policy for Java
prevented an applet from accessing data other than from the site the
applet was delivered from. In that case, you'de need to look at how to
alter the security policy (if it can be done for an applet).

Tony
Jul 17 '05 #2
Jeff Napier wrote:
Can someone tell me how to display an image from a website other than the
one the applet is on?


You basically have three options:

1) Sign your applet so it get more privileges.
You need an expensive certificate to do that and your users will have to
confirm a dialog box.

2) Make a little gateway on your server. This can be done with two lines
of PHP code. Give the URL of the foreign image as an parameter to your
script en let the script fetch and output the image.

3) Use Dynamic HTML (you can call JavaScript form within your applet
with LiveConnect [netscape.javasc ript.JSObject]).

Edwin Martin.

--
http://www.bitstorm.org/
Jul 17 '05 #3
Edwin Martin wrote:
Jeff Napier wrote:
Can someone tell me how to display an image from a website other than the
one the applet is on?

You basically have three options:

1) Sign your applet so it get more privileges.
You need an expensive certificate to do that and your users will have to
confirm a dialog box.


This is a popular misconception. You can create your own certificates
for free using the tools from Sun. The difference is that user will see
that you issued yourself your own certificate and it did not come from a
third party.

HTH,
Ray

--
XML is the programmer's duct tape.
Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
6770
by: Tyrone Slothrop | last post by:
I am coding a site which involves uploading images. All of the PHP and display is OK but the client wants to be able to display the image thumbnail on the upload page and show the full image on mouseOver instead of the popup I coded. The section of code below works perfectly in Firefox but not at all in IE (why am I not surprised?). The page is nearly 100% dynamic, so this is extracted from the source of a test page. The code in...
7
1809
by: DavidM | last post by:
Hello -- I would like to display a different logo on my website for different seasons of the month. I currently have a logo for Halloween, Thanksgiving, and December. Can someone tell me what VBScript/ASP code I need to display an HTML image. Basically: 1) any date from 10/01 thru 10/31 I would like to display the Halloween. 2) any date between 11/01 - 11/30, I would like to display Thanksgiven.
3
2244
by: c676228 | last post by:
Hi everyone, I have a piece of code in sales.aspx.vb like this: Protected WithEvents Message As System.Web.UI.WebControls.Label Try ... ChartImage.ImageUrl = "ChartGenerator.aspx?" + DataStr + "&ChartType=" + drpChartType.SelectedItem.Value.ToLower() + "&Print=" + printVersion.ToString() ... Catch e As Exception
18
2481
by: fishwick | last post by:
I haven't really done any css in quite a while, and am banging my head against the wall trying get the rudimentary layout together of a church website home page to display correctly - I don't want to continue work until I understand what I'm doing wrong. http://www.christchurchinfo.net The site displays nicely in Firefox/Mozilla and Safari, but the stained glass windows navigation portion is getting pushed down in IE, and the "news"...
1
2388
by: sneeka2 | last post by:
Hi, I'm developing a portfolio site, which contains a bunch of thumbnails wrapped in links: <a href="..."><img ... /></a>. A window.onload script inserts an onclick property into the links which changes their behaviour to load the big image in a <div> on the same page, instead of going to another site. For that purpose I have a <div><img ... /></div> construct in the page which is set to a fixed height and width and 'display: none' via CSS....
1
9653
by: mrquestions | last post by:
Hey, new to the forum, have looked everywhere for some information of the following query but can't find it anywhere... Within a site I am building a division calls on an include function to display a webpage ($page), so only the one template page is used throughout the entire site. It has been all smooth sailing up until I wanted to have a MouseOver image (image.src), become "selected" upon requesting its specific page. <? if ($page =...
1
2975
by: pkamil83 | last post by:
Hello I've got a table on SQL Server 2005 with columns: ID int Text XML Image varbinary(max) In this table I'm having SVG images. All I have to do is to display those images on ASP.NET 2 web site (C#),
9
2582
by: tshad | last post by:
This was posted before but the message got messed up (all NLs were stripped out for some reason). I have 2 labels that hold the name of different images on my .aspx page. <asp:Label ID="Logo" runat="server"/> <asp:Label ID="CompanyPicture" runat="server"/> I have 2 links that open the windows to preview these images. The previewed images are done on separate html pages that do nothing but display the
1
2981
by: amritranjan | last post by:
How to retrive image file from MS access database and display this in another JSPpage -------------------------------------------------------------------------------- This is my Jsp code for image upload in database: -----------Upload.jsp---------------- <html> <head> <title>Account Details </title>
0
8367
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8279
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8811
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8703
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8467
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6160
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5619
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4145
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4291
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.