When I Upload Something It Says Fakepath

  1. #1

    pegaso52it is offline

    Sencha Premium Member


    Default Answered: Chrome shows always "c:\fakepath\..." in upload field instead of the right path

    Hi I'm using Chrome Version 27.0.1453.116 m.

    I've a problem in my custom application using File Upload Field
    that happens also in online samples application.

    Employ
    http://docs.sencha.com/extjs/4.two.ane/e...le-upload.html

    Use the outset example "Bones File Field", then click "Browse..." push button and select the file you desire.
    The problem is that in upload field the file proper noun is correct but the file path shows ever: c:\fakepath\...
    Besides using the "Get File Path" push button under the upload field is shown the wrong path.

    Then the upload does not works correctly (due to wrong path, I imagine)

    With Firefox using the same example are there no problem,

    Please, could someone help me to solve this trouble?


  2. All-time Answer

    Posted by existdissolve

    Quote Originally Posted by dtex-lab View Post

    As pegaso52it wrote

    in the official example at
    http://docs.sencha.com/extjs/4.2.i/e...le-upload.html

    the trouble exists

    so aught to do with extension done.

    from official case, please fill the Basic File Field using the scan button yous can see that the fully qualified path name is starting with C:\fakepath and not the one really selected.

    and besides in the example description information technology says
    "The file path reported past the getValue method will"

    I read in docs that the setValue is "browser dependent",

    The goal is to know from which location of the client the file is uploaded

    Anyway i confirm that upload is working anycase
    Probably if you are using that informtion for you logging... information technology is incorrect and I agree it is a problem in some cases

    I understand the "problem" equally stated, but it's not really a problem, at least non from an Ext JS perspective. JavaScript does non, and should non , take access to the client's file system, so I'm not sure why anyone would recall they should exist able to go the full path to a file from a client's machine.

    Moreover, I tin't understand why one would need that anyway. You certainly don't demand it to upload a file, and then the simply reason would exist a nefarious 1 (or a misguided one that doesn't understand 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 use the site if I knew they were able to practise that. They tin can take no possible reason to need to know that, unless of course I am installing a plan (not JavaScript, of course) in which I grant access to that kind of information.


  3. #two

    Default

    Quote Originally Posted by pegaso52it View Post

    Hullo I'one thousand using Chrome Version 27.0.1453.116 m.

    I've a problem in my custom awarding using File Upload Field
    that happens besides in online samples application.

    Employ
    http://docs.sencha.com/extjs/4.2.i/e...le-upload.html

    Utilise the first example "Basic File Field", then click "Scan..." button and select the file yous want.
    The problem is that in upload field the file proper noun is right only the file path shows ever: c:\fakepath\...
    As well using the "Become File Path" button nether the upload field is shown the wrong path.

    Then the upload does not works correctly (due to wrong path, I imagine)

    With Firefox using the aforementioned case are at that place no problem,

    Delight, could someone assist me to solve this problem?

    Bank check out the first couple of paragraphs in the documentation for Ext.form.field.File: http://docs.sencha.com/extjs/iv.two.1/#...orm.field.File

    The result of getValue() is entirely browser-dependent.

    Still, this should have nothing to do with the upload succeeding or failing, as information technology 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 exercise file uploads with Ext.course.field.File, so there may be an issue with your implementation if it is succeeding in one browser simply failing in some other. Can yous share some of the code that is declining?


  4. #three

    pegaso52it is offline

    Sencha Premium Member


    Default

    Hi, thank for your answer, beginning of all.
    Alibi me if I have not respond quickly, just I was very decorated with other activities.

    That's my code that works using Firefox:

    Code:

    MY.Ext.form.MYFileUploadField = Ext.extend(Ext.ux.form.FileUploadField,       {          bindListeners : office()          {             MY.Ext.form.MYFileUploadField.superclass.bindListeners.telephone call(this);             this.fileInput.on(                   {                      scope : this,                      change : function()                      {                         var 5 = this.fileInput.dom.value;                         this.setValue(v);                         this.iFileInputHidden.dom.value = v;                         this.fireEvent('fileselected', this, five);                      }                   });          },           createFileInput : function()          {             MY.Ext.form.MYFileUploadField.superclass.createFileInput.call(this);             this.iFileInputHidden = this.wrap.createChild(                   {                      id : this.hiddenId,                      name : this.hiddenId,                      tag : 'input',                      type : 'hidden',                      value : ''                   });          }       });


  5. #4

    Default

    Quote Originally Posted by pegaso52it View Post

    Hello, thank for your answer, first of all.
    Excuse me if I have non answer quickly, but I was very busy with other activities.

    That'south my lawmaking that works using Firefox:

    Code:

    MY.Ext.form.MYFileUploadField = Ext.extend(Ext.ux.form.FileUploadField,       {          bindListeners : function()          {             MY.Ext.form.MYFileUploadField.superclass.bindListeners.call(this);             this.fileInput.on(                   {                      scope : this,                      change : part()                      {                         var v = this.fileInput.dom.value;                          this.setValue(5);                         this.iFileInputHidden.dom.value = v;                         this.fireEvent('fileselected', this, five);                          }                   });          },           createFileInput : function()          {             MY.Ext.course.MYFileUploadField.superclass.createFileInput.call(this);             this.iFileInputHidden = this.wrap.createChild(                   {                      id : this.hiddenId,                      name : this.hiddenId,                      tag : 'input',                      type : 'hidden',                      value : ''                   });          }       });
    If yous're depending on the fleck bolded above (e.g., the setValue()), it'south not going to piece of work consistently. Again, if you read the docs (http://docs.sencha.com/extjs/4.ii.1/#...orm.field.File) y'all'll meet that setValue() and getValue() are non implemented the same for the File field as for other ExtJS form fields, because of the cantankerous-browser implementation differences.


  6. #five

    dtex-lab is offline

    Ext JS Premium Fellow member


    Default

    Every bit pegaso52it wrote

    in the official example at
    http://docs.sencha.com/extjs/four.2.1/e...le-upload.html

    the problem exists

    then nothing to do with extension done.

    from official example, please fill up the Basic File Field using the scan button you can see that the fully qualified path proper name is starting with C:\fakepath and not the 1 really selected.

    and also in the example clarification 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 client the file is uploaded

    Anyway i ostend that upload is working anycase
    Probably if you lot are using that informtion for yous logging... information technology is wrong and I agree it is a problem in some cases


  7. #6

    Default

    Quote Originally Posted past dtex-lab View Post

    Every bit pegaso52it wrote

    in the official example at
    http://docs.sencha.com/extjs/4.two.1/e...le-upload.html

    the trouble exists

    then nothing to do with extension done.

    from official case, delight fill the Basic File Field using the browse button you tin can see that the fully qualified path proper noun is starting with C:\fakepath and not the one actually selected.

    and also in the example clarification 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 client the file is uploaded

    Anyway i confirm that upload is working anycase
    Probably if you are using that informtion for you lot logging... it is wrong and I agree it is a problem in some cases

    I empathize the "problem" equally stated, simply information technology's not really a problem, at to the lowest degree not from an Ext JS perspective. JavaScript does not, and should not , have admission to the client'due south file system, and so I'm non certain why anyone would think they should be able to get the total path to a file from a customer's machine.

    Moreover, I tin't sympathise why i would need that anyway. You certainly don't need it to upload a file, so the but reason would be a nefarious one (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 employ the site if I knew they were able to do that. They tin can have no possible reason to demand to know that, unless of class I am installing a program (not JavaScript, of course) in which I grant access to that kind of information.


  8. #7

    pegaso52it is offline

    Sencha Premium Member


    Default

    Thank you for your assistance, I have solved the problem.


  9. #8

    mrinal3199 is offline

    Sencha User


    Default fakepath problem

    Hi,

    How you slved information technology?? Can yu share information technology with me. I am also getting same error as C:\fakepath\*...xls in chrome.

    Thanks in advance.


  10. #9

    Default

    Quote Originally Posted by mrinal3199 View Post

    How-do-you-do,

    How you lot slved information technology?? Tin can yu share it with me. I am also getting same fault as C:\fakepath\*...xls in chrome.

    Thanks in advance.

    There's null to "solve". Review the answer to this thread--information technology gives the information you need. Also, be enlightened that this has zilch to do with Ext JS, but is rather more a question of how browser's work and the access which JavaScript has to the client car.


  11. #x

    mrinal3199 is offline

    Sencha User


    Default

    How-do-you-do,
    It's a combination of html and coffee script file which information technology is calling. You mean to say there is no style to get the correct filepath in chrome in this style? I could sympathize the security which chrome provides in looking for local drives. But is in that location any alternate way to get the required filepath non just the filename every bit we are getting in IE afterward setting changes?

    Thanks again


goinshimme1986.blogspot.com

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 "When I Upload Something It Says Fakepath"

Postar um comentário

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel