IE8 upload control shows "c:\fakepath\"

36 posts, 0 answers
  1. Jay O'Brien
    Jay O'Brien avatar
    36 posts
    Member since:
    Dec 2008

    Posted 09 Apr 2009 Link to this post

    Using the Rad upload control in IE 8, it now shows c:\fakepath\myfile.doc when I browse to a file. It replaces the actual local path with c:\fakepath ... why is this?

    thanks,
    Jay

  2. Matthew Bishop
    Matthew Bishop avatar
    53 posts
    Member since:
    Apr 2007

    Posted 17 Apr 2009 Link to this post

    Jay,
    Im also using IE8 and I dont have this error.

    But... after thinking about it have you tried putting a normal upload control on the page? If so, do you get the same error? Because the Telerik controls prob just piggyback on the back of the normal control. You could try the old html version of the file upload as well to see if the same problem occurs.

    Normal aspx control

    <

     

    asp:FileUpload ID="FileUpload1" runat="server" />

     


    Old html version of the upload.

    <

     

    input type="file" name="htmlFileUpload" size="40"/>

     


    As far as I know, IE keeps the default upload directory, rather then the page that is serving the control.

    Hopefully something there helps,
    Matt

  3. Jay O'Brien
    Jay O'Brien avatar
    36 posts
    Member since:
    Dec 2008

    Posted 17 Apr 2009 Link to this post

    Wow, I am surprised more people haven't been hit with this yet.

    Try this page (with IE 8):
    http://demos.telerik.com/aspnet-ajax/upload/examples/clientsidevalidation/defaultcs.aspx

    There is a new security "feature" in IE 8 that hides the real path of the selected file from JavaScript calls (it returns c:\fakepath\). This seems to only be activated for "Internet" servers ... not Local intranet servers (perhaps that's what is hiding this error from most of us).

    The reason it shows up is that the Telerik upload control is actually hiding the "real" upload control, and adding a "skinned" upload control and edit box. They populate the input box using JavaScript, and thus, get the "c:\fakepath\".

    Telerik, is this something that can be fixed?

    Thanks,
    Jay

  4. Matthew Bishop
    Matthew Bishop avatar
    53 posts
    Member since:
    Apr 2007

    Posted 17 Apr 2009 Link to this post

    Hi Jay,
    thanks for that info. Yet another security update to work around...yay!

    Btw, if you add the site to your trusted sites then you get the full path. Not that you can ask everyone to add your site to their trusted sites list, but with our web application they have to so I dont see the error unless I take it off the trusted sites list.

    Maybe that helps... but prob not :/

    Matt

  5. Jay O'Brien
    Jay O'Brien avatar
    36 posts
    Member since:
    Dec 2008

    Posted 17 Apr 2009 Link to this post

    That makes sense. I think the "fix" is to add this to our product's documentation so the users dont freak out when they see this. Everything still works fine ... it just might scare users the first time when they see c:\fakepath.

    I am afraid there is probably no way for Telerilk to work around this (as long as they are "hiding" the original upload control).

    Thanks,
    Jay

  6. Erjan Gavalji
    Admin
    Erjan Gavalji avatar
    1411 posts
    Member since:
    Sep 2012

    Posted 20 Apr 2009 Link to this post

    Hi guys,

    A good discussion indeed (sorry for not being able to reply earlier).

    As you already noted, the "fakepath" is related to the IE8 security feature, which makes it impossible for us to change the value.

    I was thinking about the possibility that we check for the "fakepath" string and change it to something more meaningful in the "skinned" mode of RadUpload (e.g. EnableFileInputSkinning="true"). To my regret that would result in inconsistent behavior between the "skinned" and "unskinned" modes of the control. What I mean is that when EnableFileInputSkinning is set to "false", RadUpload uses the plain old HTML file input fields and we have not control over them via JavaScript.

    By the way, there is a workaround to avoid users from seeing the "fakepath". It is the following:

    1. Add a client-side event handler to the OnClientFileSelected event
    2. The event handler should check if the user is running IE8, if RadUpload is in "skinned" mode and if the selected path contains the "fakepath" string
    3. If the above conditions true the event handler should find a reference to the fake input textbox and change the value to something meaningful, e.g. [SelectionPath]\MyFile.gif

    Best regards,
    Erjan Gavalji
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.

  7. Sven
    Sven avatar
    2 posts
    Member since:
    Apr 2009

    Posted 05 May 2009 Link to this post

    Hello Erjan,

    currently i am facing the same problem with the "fakepath".
    According to your point 3 of the workaround:

    3.    If the above conditions true the event handler should find a reference to the fake input textbox and change the value to something   meaningful, e.g. [SelectionPath]\MyFile.gif

    Could you help me finding the input box. I think you mean this input field, right?
    <input class="ruFakeInput" size="39" _events="[object Object]"/>

    Do i have to iterate throug the objects to get that field, because it has no id?
    Thansk for any help for that workaround.

    Another question i have is, that if my Upload page is loaded the first time in IE 8 it seems that the fake input field is in front of the 'Browse' Button and it becomes quiet difficult to click it. Anyone faces this problem too?

    Thanks,

    Greets Sven 



  8. Erjan Gavalji
    Admin
    Erjan Gavalji avatar
    1411 posts
    Member since:
    Sep 2012

    Posted 05 May 2009 Link to this post

    Hi Sven,

    You get a reference to the current row in the event arguments. Using the _getChildFileNameInputField method of RadUpload gives a reference to the fake text input element. Here is the simplest event handler:

    function OnClientFileSelected(sender, args)
    {
        var row = args.get_row();
        var fakeFileNameInput = sender._getChildFileNameInputField(row);
        var fakePathString = "fakepath";
        if (fakeFileNameInput.value.indexOf(fakePathString) == 0)
        {
            int fakePathLength = fakePathString.length;
            fakeFileNameInput.value = "[SelectionPath]" + fakeFileNameInput.value.substring(fakePathLength);
        }
    }


    As per the browse button clicking - we identified the problem some time after the official service pack and it is fixed in the latest unofficial build. Just to ensure it is not a different problem, can you please, download it, replace the assemblies in your website and check if the problem still exists on your side?

    Best regards,
    Erjan Gavalji
    the Telerik team


    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.

  9. Stacy Draper
    Stacy Draper avatar
    1 posts
    Member since:
    Mar 2006

    Posted 10 Aug 2009 Link to this post

    Also, ensure tehre is an images folder on the server.  It doesn't appear that it's created automatically for you.

  10. Justin Crossley
    Justin Crossley avatar
    3 posts
    Member since:
    Jan 2005

    Posted 26 Aug 2009 Link to this post

    there are a coupple of bugs in this code, otherwise it works fine!
    It should be:

            function OnClientFileSelected(sender, args)
            {
                var row = args.get_row();
                var fakeFileNameInput = sender._getChildFileNameInputField(row);
                var fakePathString = "fakepath";
                if (fakeFileNameInput.value.indexOf(fakePathString) != 0)
                {
                    var fakePathLength = fakePathString.length;
                    fakeFileNameInput.value = "[SelectionPath]" + fakeFileNameInput.value.substring(fakePathLength);
                }
            }        

  11. Justin Crossley
    Justin Crossley avatar
    3 posts
    Member since:
    Jan 2005

    Posted 26 Aug 2009 Link to this post

    whoops! Should be:

            function OnClientFileSelected(sender, args)
            {
                var row = args.get_row();
                var fakeFileNameInput = sender._getChildFileNameInputField(row);
                var fakePathString = "fakepath";
                if (fakeFileNameInput.value.indexOf(fakePathString) != 0)
                {
                    var fakePathLength = fakePathString.length;
                    fakeFileNameInput.value = fakeFileNameInput.value.replace(fakePathString,"[SelectionPath]");
                }
            }        

  12. Freedy Carvalho
    Freedy Carvalho avatar
    1 posts
    Member since:
    Sep 2009

    Posted 08 Sep 2009 Link to this post

    Para você resolver esse problema, tem que incluir a URL do site nas configurações de segurança do IE 8 ou do browser que estiver utilizando.
    Entre na aba "segurança", "sites confiáveis" e inclua a URL do seu site. Caso ele não tenha HTTPS, lembre-se de desativar a opção de verificação do certificado seguro. Terminada a configuração, sempre é bom fechar e abrir o navegador novamente para evitar problemas.

    Qualquer dúvida, estou à disposição.

    Abraço !


  13. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1553 posts
    Member since:
    Dec 2014

    Posted 09 Sep 2009 Link to this post

    Hi guys

    I am happy to announce that the issue is fixed for the current internal build. Now RadUpload shows only the filename, without the "C:\fakepath\" prefix. You can verify on our online demos.



    Regards,
    Genady Sergeev
    the Telerik team


    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.

  14. Michael Rolfes
    Michael Rolfes avatar
    1 posts
    Member since:
    Sep 2009

    Posted 25 Sep 2009 Link to this post

    Do you have an estimate when this fix will be available for release?

  15. Matt
    Matt avatar
    5 posts
    Member since:
    Sep 2007

    Posted 20 Nov 2009 Link to this post

    This might be slightly better:
    String.indexOf -1 means not found, 0 or greater means found at that index, so you need to account for all cases where indexOf the fakepath is greater than -1.  Also, replace doesn't work if you are trying to update C:\fakepath\filename.ext to filename.ext.  You need to use a substring that starts after c:\fakepath\ ends.  Or it could be x:\fakepath\ so you can't just change fakePathString to "C:\fakepath" to fix.

    function OnClientFileSelected(sender, args)
            {
                var row = args.get_row();
                var fakeFileNameInput = sender._getChildFileNameInputField(row);
                var fakePathString = "fakepath";
                if (fakeFileNameInput.value.indexOf(fakePathString) > -1)
                {
                    var fakePathLength = fakePathString.length + fakeFileNameInput.value.indexOf(fakePathString) + 1;
                    fakeFileNameInput.value = fakeFileNameInput.value.substring(fakePathLength);
                }
            }

  16. Majid Darab
    Majid Darab avatar
    110 posts
    Member since:
    Sep 2012

    Posted 26 Feb 2010 Link to this post

    hi my dear friends:
    i want to show the selected image of my radupload without postback...
    so i used this help : How-To > Preview an image before upload
    but the problem C:\fakePath is still there in radupload...in ie 8
    how can i fix this really junky problem?
    thanks for your attention...

  17. Majid Darab
    Majid Darab avatar
    110 posts
    Member since:
    Sep 2012

    Posted 26 Feb 2010 Link to this post

    this link tell us it's fixed , but not and problem is stil there:
    http://www.telerik.com/products/aspnet-ajax/whats-new/release-history/q2-2009-sp1-version-2009-2-826.aspx
    also i am using the latest hotfix -> 1319

  18. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1553 posts
    Member since:
    Dec 2014

    Posted 01 Mar 2010 Link to this post

    Hi Majid Darab,

    Can you tell us the exact version of the IE browser that you use? It can be seen from Help -> About Internet Explorer

    Regards,
    Genady Sergeev
    the Telerik team


    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.

  19. Majid Darab
    Majid Darab avatar
    110 posts
    Member since:
    Sep 2012

    Posted 01 Mar 2010 Link to this post

    please review my 2 before posts -> IE 8

  20. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1553 posts
    Member since:
    Dec 2014

    Posted 02 Mar 2010 Link to this post

    Hello Majid Darab,

    I meant the exact version of IE8. We have checked out the online demos and some sample projects, however we didn't manage to reproduce the issue. The only fault that we found is that the tooltip still shows C:\fakepath\ instead of the selected file filename. We have fixed that and forth from the Q1 release (which is scheduled for the next week) we will standardize the tooltip and the value to show the selected file filename only.

    Regards,
    Genady Sergeev
    the Telerik team


    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.

  21. VnDevil
    VnDevil avatar
    52 posts
    Member since:
    Oct 2012

    Posted 13 Mar 2010 Link to this post

    I'm using IE8 version: 8.0.7600.16385, RadControls Q3 2009 (RadControls_for_ASP.NET_AJAX_2009_3_1208_dev) and that issue is stil there


  22. Majid Darab
    Majid Darab avatar
    110 posts
    Member since:
    Sep 2012

    Posted 14 Mar 2010 Link to this post

    I'm using IE8 version: 8.0.6001.18702, RadControls Q3 2009 (RadControls_for_ASP.NET_AJAX_2009_3_1319_dev) and that issue is stil there

  23. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1553 posts
    Member since:
    Dec 2014

    Posted 16 Mar 2010 Link to this post

    Hello Majid Darab,

    Do you use RadUpload with its skinning disabled?

    Regards,
    Genady Sergeev
    the Telerik team


    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.

  24. Majid Darab
    Majid Darab avatar
    110 posts
    Member since:
    Sep 2012

    Posted 16 Mar 2010 Link to this post

    hi my dear friend...
    i am using my custom skin for my RadUpload :
    so My RadUpload Is LIke This :

                                            <telerik:RadUpload ID="ruPersonelPixInvwPersonelEdit" runat="server" AllowedFileExtensions=".jpg,.jpeg,.gif,.bmp" 
                                                AllowedMimeTypes="image/gif,image/jpeg,image/pjpeg,image/bmp,image/x-windows-bmp" 
                                                ControlObjectsVisibility="ClearButtons" EnableEmbeddedSkins="False" EnableTheming="True" 
                                                Font-Names="Tahoma" InputSize="45" MaxFileInputsCount="1" OnClientFileSelected="CheckExtension" 
                                                Skin="Office2007ByMe" MaxFileSize="4194304"
                                                <Localization Add="Addd" Clear="Clearr" Delete="Deletee" Remove="Removee" 
                                                    Select="Selectt" /> 
                                            </telerik:RadUpload> 

    best regards


  25. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1553 posts
    Member since:
    Dec 2014

    Posted 22 Mar 2010 Link to this post

    Hello Majid Darab,

    We are not able to reproduce the described behavior using the version you have specified. Could you please open a support ticket and send us sample project containing your custom skin and that reproduces the issue. This will greatly ease us in finding out what is going wrong in your case.

    Greetings,
    Genady Sergeev
    the Telerik team


    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.

  26. Tim
    Tim avatar
    79 posts
    Member since:
    Feb 2008

    Posted 28 Apr 2010 Link to this post

    I just ran into this one too and just want to confirm the new behavior.

    Looking at the 2010Q1 behavior and the demo site, is the new behavior to now never show the full path?  Every file I have selected to upload only shows the file name and not full path.

    per the above post,
    "I am happy to announce that the issue is fixed for the current internal build. Now RadUpload shows only the filename, without the "C:\fakepath\" prefix. You can verify on our online demos."

    I was expecting the full path to remain, and if this fakepath happened we would only show the filename.

    Thanks
    Tim

  27. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1553 posts
    Member since:
    Dec 2014

    Posted 29 Apr 2010 Link to this post

    Hi Tim,

    We decided to standardize the RadUpload's behavior over the different browsers. Since all browsers except for IE show only the filename we modified RadUpload so that the uploaded files names follow this pattern.


    Kind regards,
    Genady Sergeev
    the Telerik team


    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.

  28. Matthew
    Matthew avatar
    1 posts
    Member since:
    Apr 2010

    Posted 29 Apr 2010 Link to this post

    Has the tooltip issue been resolved? Because I'm still getting "C:\fakepath\" as the tooltip about half of the time. Rest of the time it says "[object]".

  29. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1553 posts
    Member since:
    Dec 2014

    Posted 30 Apr 2010 Link to this post

    Hi Matthew,

    The issue is not yet fixed. We will try to resolve it for the next week's internal build. More information on how to obtain the latest internal build can be found here.

    Regards,
    Genady Sergeev
    the Telerik team


    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.

  30. HananJ
    HananJ avatar
    15 posts
    Member since:
    Nov 2010

    Posted 30 Nov 2010 Link to this post

    Actually I have another question about the FIle Upload, Why I couldn't get the full path at server side, it is always null; FYI,  I put the controls in RadAjaxPanel; Does that in turn cause any problems, Plus About the FakePath issue, I tried The HTML control instead of ASP.NET, but still getting the same issue, FakePath.... ! e.g. C:\\fakepath\\WizardButtons.nl-NL.resx

    I need to get the physical path not to hide it, because it is necessarily to be loaded into an XMLDocument...!
     Any Idea, I will keep googling anyways ..!

Back to Top