How to Get Rid of C:fakepath in Ie When Uploading a File to the Website [fix]
-
three Jul 2013,ane:20 AM #1
Sencha Premium Member
Answered: Chrome shows e'er "c:\fakepath\..." in upload field instead of the right path
Hi I'thou using Chrome Version 27.0.1453.116 1000.
I've a problem in my custom application using File Upload Field
that happens also in online samples application.Use
http://docs.sencha.com/extjs/4.2.1/e...le-upload.htmlUse the first example "Basic File Field", then click "Browse..." push and select the file you desire.
The trouble is that in upload field the file name is right but the file path shows ever: c:\fakepath\...
Also using the "Become File Path" push button under the upload field is shown the wrong path.And so the upload does not works correctly (due to wrong path, I imagine)
With Firefox using the same example are at that place no trouble,
Please, could someone help me to solve this problem?
- Best Reply
Posted by existdissolve
Originally Posted by dtex-lab
Moreover, I can't understand why one would need that anyhow. You certainly don't need it to upload a file, and so the only reason would exist a nefarious i (or a misguided one that doesn't empathise how file uploads work).
I would personally HATE to know that someone was tracking or logging the path to a file on my computer, and would never apply the site if I knew they were able to practice that. They tin can take no possible reason to need to know that, unless of course I am installing a program (non JavaScript, of course) in which I grant access to that kind of information.
-
3 Jul 2013,4:05 AM #2
Originally Posted by pegaso52it
The issue of getValue() is entirely browser-dependent.
All the same, this should take nothing to do with the upload succeeding or declining, as it is the content of the form field, not the path, which is ultimately put in the mail to the server.
I have several applications that do file uploads with Ext.form.field.File, so at that place may be an issue with your implementation if information technology is succeeding in i browser merely failing in some other. Can you lot share some of the lawmaking that is failing?
-
four Jul 2013,1:forty AM #3
Sencha Premium Fellow member
Hi, thank for your answer, first of all.
Alibi me if I have non reply quickly, but I was very busy with other activities.That's my code that works using Firefox:
Code:
MY.Ext.form.MYFileUploadField = Ext.extend(Ext.ux.grade.FileUploadField, { bindListeners : role() { MY.Ext.grade.MYFileUploadField.superclass.bindListeners.call(this); this.fileInput.on( { scope : this, modify : function() { var 5 = this.fileInput.dom.value; this.setValue(v); this.iFileInputHidden.dom.value = five; this.fireEvent('fileselected', this, five); } }); }, createFileInput : office() { MY.Ext.form.MYFileUploadField.superclass.createFileInput.call(this); this.iFileInputHidden = this.wrap.createChild( { id : this.hiddenId, name : this.hiddenId, tag : 'input', type : 'hidden', value : '' }); } });
-
four Jul 2013,2:07 AM #iv
Originally Posted by pegaso52it
-
5 Jul 2013,4:31 AM #5
Ext JS Premium Member
As pegaso52it wrote
in the official example at
http://docs.sencha.com/extjs/4.2.one/e...le-upload.htmlthe problem exists
and so nil to practise with extension done.
from official example, please fill the Bones File Field using the browse button y'all can come across that the fully qualified path proper noun is starting with C:\fakepath and not the one really selected.
and also in the instance description it says
"The file path reported by the getValue method will"I read in docs that the setValue is "browser dependent",
The goal is to know from which location of the customer the file is uploaded
Anyway i confirm that upload is working anycase
Probably if yous are using that informtion for y'all logging... information technology is wrong and I agree it is a problem in some cases
-
five Jul 2013,4:53 AM #6
Originally Posted by dtex-lab
Moreover, I tin can't empathise why one would need that anyway. You certainly don't need information technology to upload a file, then the but reason would exist a nefarious i (or a misguided i that doesn't empathize how file uploads piece of work).
I would personally Hate to know that someone was tracking or logging the path to a file on my computer, and would never employ the site if I knew they were able to do that. They can have no possible reason to need to know that, unless of form I am installing a program (non JavaScript, of course) in which I grant access to that kind of data.
-
sixteen Jul 2013,v:sixteen AM #7
Sencha Premium Fellow member
Cheers for your assistance, I have solved the problem.
-
13 Feb 2014,five:17 AM #viii
Sencha User
fakepath problem
Hi,
How you lot slved it?? Tin yu share it with me. I am also getting same error as C:\fakepath\*...xls in chrome.
Thanks in advance.
-
13 Feb 2014,6:34 AM #nine
Originally Posted by mrinal3199
-
thirteen February 2014,11:05 PM #ten
Sencha User
Hi,
It's a combination of html and java script file which information technology is calling. You mean to say there is no style to get the correct filepath in chrome in this way? I could understand the security which chrome provides in looking for local drives. But is at that place any alternate way to go the required filepath not just the filename as we are getting in IE after setting changes?Cheers once more
Source: https://forum.sencha.com/forum/showthread.php?267159-Chrome-shows-always-quot-c-fakepath-quot-in-upload-field-instead-of-the-right-path
0 Response to "How to Get Rid of C:fakepath in Ie When Uploading a File to the Website [fix]"
Post a Comment