judsonmusic
asked on
undefined is null or not an object on upload script
I am getting a underfined is null or not an object when I click the button that runs this script in IE 7. it works fine in ie8, etc. What could it be>???
function Upload()
{
var objFlash;
var iFlashUploadResult;
if (navigator.appName.indexOf ("Microsof t")!=-1) objFlash=window.Picture;
else objFlash=window.document.P icture;
iFlashUploadResult=objFlas h.FlashUpl oad_DoUplo ad();
if (iFlashUploadResult)
{
//alert('Message sent!');// uploading
}
else
{
alert("Please select file to upload first");
}
}
function Upload()
{
var objFlash;
var iFlashUploadResult;
if (navigator.appName.indexOf
else objFlash=window.document.P
iFlashUploadResult=objFlas
if (iFlashUploadResult)
{
//alert('Message sent!');// uploading
}
else
{
alert("Please select file to upload first");
}
}
ASKER
here ya go. Its a flash mutlifile uploade4r comonent:
<cfparam name="form.SessionKey" default="#replace(createuu id(),"-"," ","ALL")#" >
<cfparam name="form.Style" default="border-color:##cc cccc">
<cfparam name="form.ShowUploadButto n" default="false">
<cfparam name="form.RedirectTo" default="">
<cfparam name="form.MaxFile" default="10">
<cfparam name="form.MaxFileSize" default="999999999999">
<cfparam name="form.MaxFileSizeTota l" default="999999999999">
<cfparam name="form.FileFilter" default="">
<cfparam name="form.FlashUploadName " default="Picture">
<cfparam name="form.FirstName" default="John">
<cfparam name="form.LastName" default="Doe">
<cfparam name="form.Email" default="john@doe.com">
<cfparam name="form.SessionKey" default="">
<cfparam name="form.FlashUpload_Fil eName" default="">
<!---SEND A DOCUMENT!----------------- ---------- ---------- ---------- ---------- ---------- ---------- ------>
<!---SEND A DOCUMENT!----------------- ---------- ---------- ---------- ---------- ---------- ---------- ------>
<link href="styles.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.style5 {color: #FFFFFF}
-->
</style>
<div class="sendMessage" id="compose">
<cfif structKeyExists(form, 'send')>
<!---Loop throught the list and remove the commas--->
<cfloop index="i" from="1" to="#ListLen(form.emailTo , ';')#">
<!---Process Individually--->
<cfset temp.EmailList = #listGetAt(form.Emailto, i, ';')#>
<!---First check for the existence of an account--->
<cfquery name="checkmember" datasource="pro_healthgram ">
SELECT * FROM secureDocs_users
WHERE username = '#trim(temp.Emaillist)#'
</cfquery>
<cfif checkmember.recordcount EQ 0>
<!---USER WAS NOT FOUND!-------------------- ---------- ---------- ---------- ---------- --->
<!---CREATE ACCOUNT FOR THIS USER---------------------- ---------- ---------- ---------- -->
<cfquery name="test" datasource="pro_healthgram ">
INSERT INTO secureDocs_users(username, email, active)
VALUES(
'#trim(temp.Emaillist)#',
'#trim(temp.Emaillist)#',
'0'
)
</cfquery>
<!---getInfo on new user to create folder in folders table--->
<cfquery name="getLast" datasource="pro_healthgram ">
select TOP 1 * from
securedocs_users
ORDER BY ID DESC
</cfquery>
<!---CREATE BOXES--------------------- ---------- ---------- -------->
<cfquery name="createFoldersinbox" datasource="pro_healthgram ">
insert into secureDocs_folders(userid, folder)
values( '#trim(getLast.id)#',
'inbox'
)
</cfquery>
<!---SENT--->
<cfquery name="createFolderssent" datasource="pro_healthgram ">
insert into secureDocs_folders(userid, folder)
values( '#trim(getLast.id)#',
'sent'
)
</cfquery>
<!---TRASH--->
<cfquery name="createFolderstrash" datasource="pro_healthgram ">
insert into secureDocs_folders(userid, folder)
values( '#trim(getLast.id)#',
'trash'
)
</cfquery>
</cfif>
<!---CREATE TRACKING RECORD for -------------------------- ---------- ---------- ---------- ---------- ---------- --->
<cfquery name="createTracking" datasource="#dsn#">
INSERT INTO secureDocs_track(fromEmail , toEmail, dateSent, timeSent, status, message, subject, currentfolder)
VALUES(
'#trim(session.email)#',
'#trim(temp.Emaillist)#',
'#trim(dateformat(now(), 'mm/dd/yyyy'))#',
'#trim(timeformat(now(), 'hh:mm tt'))#',
'Not Read',
'#trim(form.message)#',
'#trim(form.subject)#',
'inbox'
)
</cfquery>
<cfquery name="getLastTrackingID" datasource="#dsn#">
SELECT TOP 1 ID
from securedocs_track
order by id desc
</cfquery>
<!---CREATE TRACKING RECORD for message with attachment!--------------- ---------- ---------- ->
<cfif isdefined('form.FlashUploa d_XMLResul t')>
<!--- loop the XML result to show files --->
<cfset myXML=xmlParse(form.FlashU pload_XMLR esult)>
<cfset xmlFileNode= XmlSearch(myXML,"/Files/Fi le")>
<cfloop from="1" to="#ArrayLen(xmlFileNode) #" index="i">
<cfset strOrigFileName=xmlFileNod e[i].Name. XMLText>
<cfset strFilePrefix=FORM.Session Key>
<CFSET ENCRYPTNAME = "#strFilePrefix#-#strOrigF ileName#">
<cfif xmlFileNode[i].Status.XMLT ext is 1>
<cfquery name="createTracking" datasource="#dsn#">
INSERT INTO secureDocs_attachments(tra ckid, ENCRYPTEDNAME, FRIENDLYNAME)
VALUES(
'#trim(getLastTrackingID.i d)#',
'#ENCRYPTNAME#',
'#strOrigFileName#'
)
</cfquery>
</cfif>
</cfloop>
</cfif>
<!---LAST SEND THE EMAIL--->
<cfmail
to="#temp.EmailList#"
from="securedocs@primarypc .com"
subject="Secure Message from Primary PhysicianCare"
type="html"
>
Primary PhysicianCare has a secure document that is ready for you to view.
<br />
<br />
This document was posted by: #trim(session.email)#
<br />
<br />
Please <a href="https://www.primarypc.com/securedocs/createAccount.cfm?email=#trim(temp.Emaillist)#">click here</a> to view this document.
</cfmail>
</cfloop>
<script>
window.init=ColdFusion.nav igate('AJA X_messageL ist.cfm?pa th=<cfoutp ut>#sessio n.path#</c foutput>&f older=<cfo utput>#ses sion.curre ntfolder#< /cfoutput> ','mainAre a');
</script>
</cfif>
<cfoutput>
<cfform action="" method="post" name="frmData">
<table width="100%" border="0" cellspacing="0" cellpadding="4">
<tr>
<td width="10%"><a href="##"><img src="images/btn_to.png" border="0" onClick="ColdFusion.Window .create('E mail List', 'Email List',
'EmailList.cfm?time=#timef ormat(now( ), 'hh:mm:ss')#',
{x:100,y:100,height:300,wi dth:400,mo dal:true,c losable:tr ue,
draggable:true,resizable:f alse,cente r:true,ini tshow:true }); clearArea();"/></a> </td>
<td width="85%"><label>
<input name="emailTo" type="text" id="emailTo" style="width:560px"/>
</label></td>
<td width="2%"> </td>
<td width="3%"> </td>
</tr>
<tr>
<td><span style="color:##FFFFFF"><b> Subject:</ b> </span></td>
<td><input name="subject" type="text" value="" style="width:560px;"/></td >
<td class="style5"> </td>
<td class="style5"> </td>
</tr>
<tr>
<td class="style5"><span style="color:##FFFFFF"><b> Message:</ b> </ span></td>
<td><br />
<textarea name="message" rows="12" style="width:560px"></text area></td> <td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
<table width="100%" align="center">
<tr>
<td width="10%"> </td>
<td width="83%"><div align="left">
<p><span style="color:##FFFFFF"><b> You may upload multiple files below:</b></span>
<input type="Hidden" name="SessionKey" value="#form.SessionKey#">
<input type="Hidden" name="FlashUpload_XMLResul t">
<input name="Send" type="hidden" value="Send" id="Send"/>
</p>
<div align="left">
<cf_flashmultiupload
name="#form.FlashUploadNam e#"
Action="upload_2_file.cfm? SessionKey =#form.Ses sionKey#"
Style="#form.Style#"
FileFilter="#form.FileFilt er#"
MaxFile="#form.MaxFile#"
MaxFileSize="#form.MaxFile Size#"
MaxFileSizeTotal="#form.Ma xFileSizeT otal#"
RedirectTo="#form.Redirect To#"
ShowUploadButton="#form.Sh owUploadBu tton#"
OnProgress="ShowStatus"
>
</div>
<form>
<input type="Button" name="Submit" value="Send Mail!" class="button" onClick="Upload();">
</form>
</div></td>
<td width="3%"> </td>
<td width="4%"> </td>
</tr>
</table>
</cfform>
</cfoutput>
</div>
<cfparam name="form.SessionKey" default="#replace(createuu
<cfparam name="form.Style" default="border-color:##cc
<cfparam name="form.ShowUploadButto
<cfparam name="form.RedirectTo" default="">
<cfparam name="form.MaxFile" default="10">
<cfparam name="form.MaxFileSize" default="999999999999">
<cfparam name="form.MaxFileSizeTota
<cfparam name="form.FileFilter" default="">
<cfparam name="form.FlashUploadName
<cfparam name="form.FirstName" default="John">
<cfparam name="form.LastName" default="Doe">
<cfparam name="form.Email" default="john@doe.com">
<cfparam name="form.SessionKey" default="">
<cfparam name="form.FlashUpload_Fil
<!---SEND A DOCUMENT!-----------------
<!---SEND A DOCUMENT!-----------------
<link href="styles.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.style5 {color: #FFFFFF}
-->
</style>
<div class="sendMessage" id="compose">
<cfif structKeyExists(form, 'send')>
<!---Loop throught the list and remove the commas--->
<cfloop index="i" from="1" to="#ListLen(form.emailTo , ';')#">
<!---Process Individually--->
<cfset temp.EmailList = #listGetAt(form.Emailto, i, ';')#>
<!---First check for the existence of an account--->
<cfquery name="checkmember" datasource="pro_healthgram
SELECT * FROM secureDocs_users
WHERE username = '#trim(temp.Emaillist)#'
</cfquery>
<cfif checkmember.recordcount EQ 0>
<!---USER WAS NOT FOUND!--------------------
<!---CREATE ACCOUNT FOR THIS USER----------------------
<cfquery name="test" datasource="pro_healthgram
INSERT INTO secureDocs_users(username,
VALUES(
'#trim(temp.Emaillist)#',
'#trim(temp.Emaillist)#',
'0'
)
</cfquery>
<!---getInfo on new user to create folder in folders table--->
<cfquery name="getLast" datasource="pro_healthgram
select TOP 1 * from
securedocs_users
ORDER BY ID DESC
</cfquery>
<!---CREATE BOXES---------------------
<cfquery name="createFoldersinbox" datasource="pro_healthgram
insert into secureDocs_folders(userid,
values( '#trim(getLast.id)#',
'inbox'
)
</cfquery>
<!---SENT--->
<cfquery name="createFolderssent" datasource="pro_healthgram
insert into secureDocs_folders(userid,
values( '#trim(getLast.id)#',
'sent'
)
</cfquery>
<!---TRASH--->
<cfquery name="createFolderstrash" datasource="pro_healthgram
insert into secureDocs_folders(userid,
values( '#trim(getLast.id)#',
'trash'
)
</cfquery>
</cfif>
<!---CREATE TRACKING RECORD for --------------------------
<cfquery name="createTracking" datasource="#dsn#">
INSERT INTO secureDocs_track(fromEmail
VALUES(
'#trim(session.email)#',
'#trim(temp.Emaillist)#',
'#trim(dateformat(now(), 'mm/dd/yyyy'))#',
'#trim(timeformat(now(), 'hh:mm tt'))#',
'Not Read',
'#trim(form.message)#',
'#trim(form.subject)#',
'inbox'
)
</cfquery>
<cfquery name="getLastTrackingID" datasource="#dsn#">
SELECT TOP 1 ID
from securedocs_track
order by id desc
</cfquery>
<!---CREATE TRACKING RECORD for message with attachment!---------------
<cfif isdefined('form.FlashUploa
<!--- loop the XML result to show files --->
<cfset myXML=xmlParse(form.FlashU
<cfset xmlFileNode= XmlSearch(myXML,"/Files/Fi
<cfloop from="1" to="#ArrayLen(xmlFileNode)
<cfset strOrigFileName=xmlFileNod
<cfset strFilePrefix=FORM.Session
<CFSET ENCRYPTNAME = "#strFilePrefix#-#strOrigF
<cfif xmlFileNode[i].Status.XMLT
<cfquery name="createTracking" datasource="#dsn#">
INSERT INTO secureDocs_attachments(tra
VALUES(
'#trim(getLastTrackingID.i
'#ENCRYPTNAME#',
'#strOrigFileName#'
)
</cfquery>
</cfif>
</cfloop>
</cfif>
<!---LAST SEND THE EMAIL--->
<cfmail
to="#temp.EmailList#"
from="securedocs@primarypc
subject="Secure Message from Primary PhysicianCare"
type="html"
>
Primary PhysicianCare has a secure document that is ready for you to view.
<br />
<br />
This document was posted by: #trim(session.email)#
<br />
<br />
Please <a href="https://www.primarypc.com/securedocs/createAccount.cfm?email=#trim(temp.Emaillist)#">click here</a> to view this document.
</cfmail>
</cfloop>
<script>
window.init=ColdFusion.nav
</script>
</cfif>
<cfoutput>
<cfform action="" method="post" name="frmData">
<table width="100%" border="0" cellspacing="0" cellpadding="4">
<tr>
<td width="10%"><a href="##"><img src="images/btn_to.png" border="0" onClick="ColdFusion.Window
'EmailList.cfm?time=#timef
{x:100,y:100,height:300,wi
draggable:true,resizable:f
<td width="85%"><label>
<input name="emailTo" type="text" id="emailTo" style="width:560px"/>
</label></td>
<td width="2%"> </td>
<td width="3%"> </td>
</tr>
<tr>
<td><span style="color:##FFFFFF"><b>
<td><input name="subject" type="text" value="" style="width:560px;"/></td
<td class="style5"> </td>
<td class="style5"> </td>
</tr>
<tr>
<td class="style5"><span style="color:##FFFFFF"><b>
<td><br />
<textarea name="message" rows="12" style="width:560px"></text
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
<table width="100%" align="center">
<tr>
<td width="10%"> </td>
<td width="83%"><div align="left">
<p><span style="color:##FFFFFF"><b>
<input type="Hidden" name="SessionKey" value="#form.SessionKey#">
<input type="Hidden" name="FlashUpload_XMLResul
<input name="Send" type="hidden" value="Send" id="Send"/>
</p>
<div align="left">
<cf_flashmultiupload
name="#form.FlashUploadNam
Action="upload_2_file.cfm?
Style="#form.Style#"
FileFilter="#form.FileFilt
MaxFile="#form.MaxFile#"
MaxFileSize="#form.MaxFile
MaxFileSizeTotal="#form.Ma
RedirectTo="#form.Redirect
ShowUploadButton="#form.Sh
OnProgress="ShowStatus"
>
</div>
<form>
<input type="Button" name="Submit" value="Send Mail!" class="button" onClick="Upload();">
</form>
</div></td>
<td width="3%"> </td>
<td width="4%"> </td>
</tr>
</table>
</cfform>
</cfoutput>
</div>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
We would be better able to help you if you showed us more of your code.