the file can not be open by a ocx when using the method [CuteWebUI_AjaxUploader_OnSelect] in ie10?

Last post 03-25-2013, 1:18 AM by cutechat. 2 replies.
Sort Posts: Previous Next
  •  03-22-2013, 12:33 AM 77086

    the file can not be open by a ocx when using the method [CuteWebUI_AjaxUploader_OnSelect] in ie10?

    hi.

        there are some codes to hash a file before upload it using a ocx.

         

      js code :

        function CuteWebUI_AjaxUploader_OnSelect(files) {
            alert(document.all("myocx").HashFile(files[0]._internaltask.file1.value));   // files[0]._internaltask.file1.value is E:\\1.txt
            alert(document.all('myocx').HashFile("D:\\1.txt"));                                    // any file not equal upload file

         }

     

        myocx.HashFile code:

          BSTR CDocEditCtrl::HashFile(LPCTSTR strFileName)
           {
               CFile clsFile;

              if (clsFile.Open(strFileName, CFile::modeRead))
              {
                 CString strReturn = "1";
                  return strReturn.AllocSysString();
              }
              else
              {
                 CString strReturn = "0";
                return strReturn.AllocSysString();
              }
          }

     

         when run these codes in ie9,ie8,ie7    the js codes will alert '1' , '1' .. every thing is ok.

         but in ie10, will alert '0' , '1' .  [clsFile.Open] return false.

     

        i send a message by [support] yesterday.  Maybe you will see the same problem.

    pls help.

         

  •  03-22-2013, 8:24 AM 77087 in reply to 77086

    Re: the file can not be open by a ocx when using the method [CuteWebUI_AjaxUploader_OnSelect] in ie10?


     

     

    e. i fix it by change openmode

     

       [CFile::modeRead] to [CFile::modeReadWrite | CFile::shareDenyNone]  can open file.... 

     

    and there is another problem

         ie10,  [files[0]._internaltask.file1.value] must be used in compatibility mode.
                how to get the full filepath? eg [c:\dicpath\1.txt] not [1.txt]

     

     without compatibility mode 

     

    compatibility mode

     

     

    We need a new version or the other way.

     

    pls help.

  •  03-25-2013, 1:18 AM 77094 in reply to 77086

    Re: the file can not be open by a ocx when using the method [CuteWebUI_AjaxUploader_OnSelect] in ie10?

    Hi,

     

    For IE10 , it changed the security policy and will not allow javascript to get the FullPath of the selected file .

     

    for temp solution , please try this meta in page <head>

     

    <meta http-equiv="X-UA-Compatible" content="IE=7" /> 

     

    To let IE choose IE7 mode.

     

    (For advanced upload tasks , we plan to make ActiveX for next Uploader4.0 version. But no release date planed yet.)

     

    Regards,
    Terry 

View as RSS news feed in XML