Groups | Blog | Home
all groups > flash data integration > february 2005 >

flash data integration : load JPG from SERVLET


Nick Zotta
2/16/2005 9:52:53 PM
Hello,

I do have a little problem and I don't know how to solve it.
I try to load a jpg (non-progressive) from an
URL (serevlet) which returns the JPG in binary
format. If I use the URL directly into the IE (browser), it's
working perfectly, I get the JPG, but when I try to use
loadMovie(URL) it doesn't work any more.

I only get this problem when I use Internet Explorer
(version 6.0, on a PC with XP - service pack 2)
It's working fine with Mozilla and FireFox.

The JAVA code I'm using to serve the JPG in binary code is:
...................
response.setContentType("image/jpeg");

OutputStream lSos = response.getOutputStream();

// the image to load
String ls_FilePathEncrypted = request.getParameter("IMG");

String ls_FilePath = decrypt(ls_FilePathEncrypted);

// read the image as a stream!
lFis = new FileInputStream(ls_FilePath);
if (lFis != null)
{
byte[] bytes = new byte[1024];
while (lFis.available() != 0)
{
int count = lFis.read(bytes);
lSos.write(bytes, 0, count);
}
}
...................

The AS code that calls the servlet is:
...................
mvContainer.loadMovie("/pathToServlet?IMG=encryptedPathToJPGfile");
...................

The jpegs I want to load are stored on a server in a private space
and I can't get them from the server with a simple direct HTTP link
to the jpg file. It would have been easy if my jpegs were stored in
a public space and I could get them with
loadMovie("http://webServer/imgPath/jpegFile.jpg"), but for security
reasons I have to use this method.
I do have one solution: copy my jpeg into a temporary public space
and then get it into the IE with a direct http link. After I load the picture,
I delete it from the temporary public space. It works, but I don't
like it very much. It has to work without temporary copies of the jpegs.

Is this a Flash Player 7 for IE bug?
Is there any solution for that?

Thank you!

Nick
perry
2/17/2005 12:32:04 PM
i remember having problems with loadMovie:
try using an absolute path instead of site root relative:
mvContainer.loadMovie(http://your.domain.com/pathToServlet?IMG=encryptedPath
ToJPGfile);

as you already set the correct content type, i don´t have any other idea ...
perry


"Nick Zotta" <webforumsuser@macromedia.com> schrieb im Newsbeitrag
news:cv0fbl$d95$1@forums.macromedia.com...
[quoted text, click to view]

Nick Zotta
2/17/2005 2:40:41 PM
Thank you, Perry, but I'm using absolute path when trying to load the jpg.
My "/pathToServlet" is actually an absolute path (
"http://www.domain.com/servlet?IMG=encryptedPathToJPGfile" ),
but in my topic (in a hurry) I put it as a relative path. It's not working,
anyway, for Internet Explorer.

Thank you for your reply.

Nick
AddThis Social Bookmark Button