Source language: Translate to:

IE8, BrowserSetElement & BrowserExecScript issues

Questions about using NeoBook's scripting language

Moderator: Neosoft Support

IE8, BrowserSetElement & BrowserExecScript issues

Postby Anemia » Sun May 03, 2009 3:34 am

Just update ie to version 8 and now facing some annoying probs. Heres part of the upload site:

Code: Select all
        Upload Image </h2>
                    </div>
                <table style="vertical-align: top;">
                    <tbody>
                    <tr class="tablerow2">
                        <td>Image</td>
                        <td>
         <input name="image_file1" id="image_file" class="indent" size="50" type="file">

         <input name="image_file2" id="image_file" class="indent" size="50" type="file">

         <input name="image_file3" id="image_file" class="indent" size="50" type="file">

         <input name="image_file4" id="image_file" class="indent" size="50" type="file">

         <input name="image_file5" id="image_file" class="indent" size="50" type="file">

         <input name="image_file6" id="image_file" class="indent" size="50" type="file">

         <input name="image_file7" id="image_file" class="indent" size="50" type="file">

                            Limitations:
                            <ul><li> Filetypes accepted: GIF, PNG, JPG and SWF</li>
                                <li> Maximum File Size: 2MB</li>
                            </ul></td>
                    </tr>
                    <tr class="tablerow1">
                        <td width="20%"></td>
                        <td width="*"><input class="text" name="action" value="Upload Image" type="submit"></td>


BrowserSetElement not working:

Code: Select all
BrowserSetElement "WebBrowser1" "image_file1" "c:/image.jpg


BrowserExecScript not working (i assume this the same as BrowserSetElement):
Code: Select all
BrowserExecScript "WebBrowser1" "document.getElementById([#34]image_file1[#34]).value=[#34]c:/image.jpg[#34];" "JScript"


yet these codelines work:

Code: Select all
BrowserExecScript "WebBrowser1" "document.getElementById([#34]image_file1[#34]).style.width=[#34]200px[#34];" "JScript"


and then the actual send command
Code: Select all
BrowserExecScript "WebBrowser1" "document.getElementById([#34]action[#34]).click()" "JScript"


so any ideas....workarounds?
Anemia
 
Posts: 9
Joined: Sat Apr 02, 2005 7:32 am

Postby Gaev » Sun May 03, 2009 4:58 am

Anemia:

The scripts that don't work are when you are attempting to use script to automatically set the name of the file to be uploaded.

This would be a dangerous script command ... imagine you navigating to a website run by evil men ... who place the same DHTML commands in their webpage document's onload section ... and naming a file in your computer that contained valuable information ... and followed it up with a simulated mouse click on the form's submit button.

Don't know if your pub worked when using IE v6 or v7 ... but they may have plugged this security hole in IE v8.

According to the latest documentation on msdn.microsoft.com for INPUT type=file.value ...
The property is read-only. The property has no default value.

Internet Explorer 8 and later. When a file is selected by using the input type=file object, the value of the value property depends on the value of the "Include local directory path when uploading files to a server" security setting for the security zone used to display the Web page containing the input object.

The fully qualified filename of the selected file is returned only when this setting is enabled. When the setting is disabled, Internet Explorer 8 replaces the local drive and directory path with the string C:\fakepath\ in order to prevent inappropriate information disclosure.

To illustrate, suppose you attempt to upload a file named C:\users\contoso\documents\file.txt. When you do this, the value of the value property is set to c:\fakepath\file.txt.
User avatar
Gaev
 
Posts: 3718
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Postby Anemia » Sun May 03, 2009 5:14 am

yep....they work in ie7 and i read about that fakepath thing, that can be turned off from internet zone options, but that doesn't really matter since it now writes anyting on inputbox --> no automated fileupload --> kinda makes my app useless =/
Anemia
 
Posts: 9
Joined: Sat Apr 02, 2005 7:32 am


Return to NeoBook Action Commands

Who is online

Users browsing this forum: No registered users and 2 guests