IE8 upload control shows "c:\fakepath\"

Thread is closed for posting
37 posts, 0 answers
  1. Simon
    Admin
    Simon avatar
    2281 posts

    Posted 06 Dec 2010 Link to this post

    Hi Hanan,

    Full path is returned only in Internet Explorer 6 and 7. The rest of the browsers do not support it so we have decided to implement the property in a standard way, i.e. it returns null. What is more the 'fake' path returned by IE8 is a feature of the browser, driven by security considerations. Finally from a developer point of view the path of the file on the client machine in most cases is irrelevant on the server where the file is uploaded as there the file resides on a different file structure. I hope this helps.

    All the best,
    Simon
    the Telerik team
    Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  2. HananJ
    HananJ avatar
    15 posts
    Member since:
    Nov 2010

    Posted 06 Dec 2010 Link to this post

    Thanks for the reply,
    Please look at this
    http://forums.asp.net/p/1628308/4194896.aspx#4194896
    it might help, I know it is not that good solution, but what else I can do.

    Best,
    Hanan
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Prajakta
    Prajakta avatar
    1 posts
    Member since:
    Nov 2011

    Posted 29 Nov 2011 Link to this post

    I want some explanation how can i remove fakepath error in chrome using the code.Pl guide
  5. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1596 posts

    Posted 02 Dec 2011 Link to this post

    Hi Prajakta,

    You can use the following code:

    <script type="text/javascript">
         
            function fileSelected(sender, args) {
                var $ = $telerik.$;
                var row = args.get_row();
     
                var value = $(row).find(".ruFakeInput").val();
                $(row).find(".ruFileInput").attr(
                {
                    title: value,
                    alt: value   
                })
                         
            }
         
        </script>
     
        <telerik:RadUpload runat="server" ID="RadUpload1" OnClientFileSelected="fileSelected">
        </telerik:RadUpload>



    Kind regards,
    Genady Sergeev
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
  6. Arefin
    Arefin avatar
    1 posts
    Member since:
    Oct 2012

    Posted 13 May 2013 Link to this post

    Hello,
    I tried this way.
    <script type="text/javascript">
    function OnClientFileSelected(sender, args) {
    var row = args.get_row();
    var fakeFileNameInput = sender._getChildFileNameInputField(row);
    var fakePathString = "C:\\fakepath";
    if (fakeFileNameInput.value.indexOf(fakePathString) == 0) {
    var fakePathLength = fakePathString.length;
    fakeFileNameInput.value = fakeFileNameInput.value.replace(fakePathString, "E:\\Itpeople");
       }
    }        
    </script>

    But it only replace the string not the actual value. After selecting a file when i hover over the upload control tooltip shows "C:\fakepath\filename.zip". So still i'm unable to upload files.
    I'm using RadControls for ASP.NET AJAX Q3 2009 SP1, because, my client want this project under this version of telerik.
    So,how can i solve this ?
  7. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1596 posts

    Posted 15 May 2013 Link to this post

    Hi Jay,

    There is no way to change the real value of the file input (it will always show fakepath  under IE, it is a security restriction that does not allow one to change it), however, you can change the title attribute of the input to change the tooltip.

    Here is some sample code:

    args.get_fileInputField().tootlip = "E:\\Itpeople";



    Kind regards,
    Genady Sergeev
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  8. siva
    siva avatar
    1 posts
    Member since:
    Apr 2015

    Posted 17 Apr 2015 in reply to Jay O'Brien Link to this post

    Even I got the same problem,later I found the solution for this issue,

    just you need to add below two lines of code in your jsp or html page..

     <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en">

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017