Thanks daynah for the reply...
Maybe this has to do with how I have layed out the script...
Here is the whole PHP script in case it matters... (I am a newbie for the PHP...)
<?php
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // some gone date
header("Last-Modified: " . gmdate ("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Pragma: no-cache"); // HTTP/1.0
?>
<HTML>
<HEAD>
<TITLE>For Lease Picture Upload Utility</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=iso-8859-1">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<SCRIPT LANGUAGE=JavaScript>
<!--
function uploadFinished()
{
var obj=parent.main.Login14;
if (obj)
{
eval('obj.GotoFrame(10)');
}
alert('Working???');
}
//-->
</SCRIPT>
</HEAD>
<BODY BGCOLOR="#FFFFFF"
TEXT="#000000"
LEFTMARGIN="0"
TOPMARGIN="0"
MARGINWIDTH="0"
MARGINHEIGHT="0"
ONLOAD="window.focus();">
<TABLE WIDTH="100%" HEIGHT="100%" BORDER="0">
<TR HEIGHT="60%">
<TD WIDTH="99%" ALIGN="center">
Please select the JPEG<br> file you want to use</TD>
<TD WIDTH="1%"></TD>
</TR>
<TR HEIGHT="10%">
<TD ALIGN="right">
<FORM ACTION="<?php echo $PHP_SELF; ?>" METHOD="POST" ENCTYPE="multipart/form-data" NAME="upload" ID="upload">
<INPUT TYPE="hidden" NAME="MAX_FILE_SIZE" VALUE="1024000">
<INPUT TYPE="file" NAME="uploadedFile" ALIGN="right"></TD>
</TR>
<TR HEIGHT="20%">
<TD ALIGN="right">
<INPUT TYPE="submit" NAME="Submit" VALUE="Submit" ALIGN="right"></TD>
</TR>
<TR HEIGHT="10%">
<TD></TD>
</TR>
</TABLE>
<?php
// code that will be executed if the form has been submitted:
$tempfile = $HTTP_POST_FILES['uploadedFile']['tmp_name'];
$temptype = $HTTP_POST_FILES['uploadedFile']['type'];
$destination = "d:\inetpub\wwwroot\Sam\Temp\\".$HTTP_POST_FILES['uploadedFile']['name'];
if ($Submit)
{
if ($temptype == "image/pjpeg")
{
if (!copy($tempfile, $destination))
print("failed to copy $destination...<br>\n");
else
{
$picsize = getimagesize("$destination");
$source_x = $picsize[0];
$source_y = $picsize[1];
print("<CENTER>Succesful copying <b>$destination</b><br>\n</CENTER>");
print("$source_x X $source_y\n");
print("<SCRIPT>uploadFinished();</SCRIPT>");
print("errorCode=0");
}
}
else
{
print("<META HTTP-EQUIV=refresh content=\"3;URL=http://localhost/Sam/UploadForm.html\">");
print("<TITLE>Upload Error</TITLE>");
print("<CENTER>Please upload JPEG file only</CENTER>");
}
}
?>
</BODY>
</HTML>
The name of the PHP file is UploadFile.php and this is called in Flash like this...
getURL("javascript:window.open('UploadFile.php','Upload_Form','width=300,height=150,top='+((screen.availHeight/2)-(" add varHeight/2 add"))+',left='+((screen.availWidth/2)-(" add varWidth/2 add "))); void(0);");
And finally the main Flash movie's name is Login14.swf and I have object tag set up like this in Login14.html...
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
WIDTH="800" HEIGHT="500" id="Login14" ALIGN="">
<PARAM NAME=movie VALUE="Login14.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF>
<EMBED src="Login14.swf" quality=high bgcolor=#FFFFFF WIDTH="800" HEIGHT="500" NAME="Login14" ALIGN=""
TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>
</OBJECT>
This is how the script flows... When this PHP code is called from the Flash, it will show the upload form in a popup window... Once the actual upload is done, it will execute the JavaScript function first, and the popup window closes in 10 seconds... If the upload fails or the file type is not the JPEG file, the popup window will refresh so that the user can upload the file again...
If that JavaScript function uploadFinished() is really executed, I'd see the alert box popup whether the Flash part is working or not, but I don't see it... 🙁
Does anybody see any strange thing I have done in here???
Thank you for your help...
Jason