Link to home
Start Free TrialLog in
Avatar of judsonmusic
judsonmusicFlag for United States of America

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("Microsoft")!=-1) objFlash=window.Picture;
                  else objFlash=window.document.Picture;
                  
                  iFlashUploadResult=objFlash.FlashUpload_DoUpload();
                  if (iFlashUploadResult)
                        {
                        //alert('Message sent!');// uploading
                        }
                  else
                        {
                        alert("Please select file to upload first");
                        }                  
                  }
Avatar of David S.
David S.
Flag of United States of America image

So  "Picture" is the ID or name of an element?

We would be better able to help you if you showed us more of your code.
Avatar of judsonmusic

ASKER

here ya go. Its a flash mutlifile uploade4r comonent:

<cfparam name="form.SessionKey" default="#replace(createuuid(),"-","","ALL")#">
<cfparam name="form.Style" default="border-color:##cccccc">
<cfparam name="form.ShowUploadButton" default="false">
<cfparam name="form.RedirectTo" default="">
<cfparam name="form.MaxFile" default="10">
<cfparam name="form.MaxFileSize" default="999999999999">
<cfparam name="form.MaxFileSizeTotal" 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_FileName" 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.FlashUpload_XMLResult')>            
        <!--- loop the XML result to show files --->
        <cfset myXML=xmlParse(form.FlashUpload_XMLResult)>
        <cfset xmlFileNode= XmlSearch(myXML,"/Files/File")>
        <cfloop from="1" to="#ArrayLen(xmlFileNode)#" index="i">
          <cfset strOrigFileName=xmlFileNode[i].Name.XMLText>
          <cfset strFilePrefix=FORM.SessionKey>
          <CFSET ENCRYPTNAME = "#strFilePrefix#-#strOrigFileName#">
          <cfif xmlFileNode[i].Status.XMLText is 1>
            <cfquery name="createTracking" datasource="#dsn#">
            INSERT INTO secureDocs_attachments(trackid, ENCRYPTEDNAME, FRIENDLYNAME)
            VALUES(
            '#trim(getLastTrackingID.id)#',
            '#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.navigate('AJAX_messageList.cfm?path=<cfoutput>#session.path#</cfoutput>&folder=<cfoutput>#session.currentfolder#</cfoutput>','mainArea');
</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('Email List', 'Email List',
        'EmailList.cfm?time=#timeformat(now(), 'hh:mm:ss')#',
        {x:100,y:100,height:300,width:400,modal:true,closable:true,
        draggable:true,resizable:false,center:true,initshow:true }); clearArea();"/></a>      </td>
      <td width="85%"><label>
        <input name="emailTo" type="text" id="emailTo" style="width:560px"/>
      </label></td>
      <td width="2%">&nbsp;</td>
      <td width="3%">&nbsp;</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">&nbsp;</td>
      <td class="style5">&nbsp;</td>
    </tr>
     
    <tr>
      <td class="style5"><span style="color:##FFFFFF"><b>Message:</b>&nbsp;</span></td>
      <td><br />
        <textarea name="message" rows="12" style="width:560px"></textarea></td><td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    </table>
    <table width="100%" align="center">
    <tr>
      <td width="10%">&nbsp;</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_XMLResult">
        <input name="Send" type="hidden" value="Send" id="Send"/>
      </p>  
   
<div align="left">
  <cf_flashmultiupload
    name="#form.FlashUploadName#"
    Action="upload_2_file.cfm?SessionKey=#form.SessionKey#"
    Style="#form.Style#"
    FileFilter="#form.FileFilter#"
    MaxFile="#form.MaxFile#"
    MaxFileSize="#form.MaxFileSize#"
    MaxFileSizeTotal="#form.MaxFileSizeTotal#"
    RedirectTo="#form.RedirectTo#"
    ShowUploadButton="#form.ShowUploadButton#"
    OnProgress="ShowStatus"
>
  </div>
    <form>
      <input type="Button" name="Submit" value="Send Mail!" class="button" onClick="Upload();">
    </form>
      </div></td>
    <td width="3%">&nbsp;</td>
      <td width="4%">&nbsp;</td>
    </tr>
    </table>
      </cfform>
  </cfoutput>
 
</div>
ASKER CERTIFIED SOLUTION
Avatar of judsonmusic
judsonmusic
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial