0

In the dialog window if you upload a swf file the link goes to the URL box in 'info'...

is it possible to have the source (the path) of where the file is copy'd from to the advance tab in title ? (just the path)

i know i have to change some stuff in the flash.js but i dont know what..in the following code is the code where the url is copyd to the info:src.

     type:'fileButton',id:'uploadButton',label:j.lang.common.uploadSubmit,filebrowser:'info:src

if i change it to advance:title the link goes to the title field but i dont want the destination url i want the source url...

1 Answer 1

1

This can't be done.

Some References:
W3C: A vocabulary and associated APIs for HTML and XHTML
4.10.7.1.18 File Upload state (type=file):
For historical reasons, the value IDL attribute prefixes the filename with the string "C:\fakepath\". Some legacy user agents actually included the full path (which was a security vulnerability).

4.10.7.4 Common input element APIs
input . value [ = value ]
filename
On getting, it must return the string "C:\fakepath\" followed by the filename of the first file in the list of selected files, if any, or the empty string if the list is empty. On setting, if the new value is the empty string, it must empty the list of selected files; otherwise, it must throw an InvalidStateError exception.

Note: This "fakepath" requirement is a sad accident of history. See the example in the File Upload state section for more information.

Mozilla Developer Network
Using files from web applications
Getting information about selected files
There are three attributes provided by the File object that contain useful information about the file.
1) name
The file's name as a read-only string. This is just the file name, and does not include any path information.

Internet Explorer Developer Center > Docs > Internet Explorer API reference > HTML/XHTML Reference > Properties >
value (Input type=file)

Remarks:
Windows 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.


Browsers don't pass the path from the client computer's directories to the web page, it's a security and privacy issue. They only pass the actual file that has been selected.

CkEditor doesn't control the file uploads. The file browser/uploader does, but it only passes the destination URL to CkEditor.

The file browser/uploader is controlled via the _source\plugins\filebrowser\plugin.js file which is called by filebrowser in the flash.js file.

You can check the location of your file browser and uploader by looking at these settings in your config:

config.filebrowserFlashBrowseUrl =

config.filebrowserFlashUploadUrl =

Based on your comments, you are using the CkFinder file manager: CkFinder - Ajax File Manager

It's produced by the same people that make CkEditor, but it's not free like CkEditor. The income from CkFinder licenses helps keep CkEditor free and up to date.

Sign up to request clarification or add additional context in comments.

5 Comments

i found the file in the source map (downloaded the zip from the site) but i use the joomla version so i cant find it... i think its this one but i am not sure: filebrowserFlashUploadUrl : '".JURI::root().$ckfinder_path."core/connector/php/connector.php?command=QuickUpload&type=Flash'"; ...now what ?
i think i should add something in the ..\plugins\editors\ckeditor\ckfinder\core\connector\php\php5\CommandHandler\FileUpload.php and QuikUpload.php.. But i really dont know what ?
i dont use the manager, i use the (check demo site 3d demo CKEditor integration, choose flash.. second tab...after you upload the file.. the direct link goes to the first tab in url...but i would like the source link (where the file was where you upload it from) to go to the advance tab and ID field..) But its impossible ?
Both of your comments say ckfinder. Yes, it's impossible to get the path to the file on the users computer. Browsers specifically block that information from being available to the webpage and the window that you use to browse for the file on your computer is through the browser. It's a security measure that is employed by all reputable browsers.
tnx guys i understand now its impossible..did not knew that it was a security vulnerability.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.