This is a migrated thread and some comments may be shown as answers.

IE8 upload control shows "c:\fakepath\"

36 Answers 1920 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Gary
Top achievements
Rank 1
Gary asked on 10 Apr 2009, 02:31 AM
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

36 Answers, 1 is accepted

Sort by
0
Matthew Bishop
Top achievements
Rank 1
answered on 17 Apr 2009, 07:32 AM
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
0
Gary
Top achievements
Rank 1
answered on 17 Apr 2009, 05:19 PM
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
0
Matthew Bishop
Top achievements
Rank 1
answered on 17 Apr 2009, 06:12 PM
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
0
Gary
Top achievements
Rank 1
answered on 17 Apr 2009, 06:36 PM
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
0
Erjan Gavalji
Telerik team
answered on 20 Apr 2009, 07:26 AM
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.
0
Sven
Top achievements
Rank 1
answered on 05 May 2009, 10:10 AM
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 



0
Erjan Gavalji
Telerik team
answered on 05 May 2009, 11:08 AM
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.
0
Stacy Draper
Top achievements
Rank 1
answered on 10 Aug 2009, 10:40 PM
Also, ensure tehre is an images folder on the server.  It doesn't appear that it's created automatically for you.
0
Justin Crossley
Top achievements
Rank 1
answered on 26 Aug 2009, 11:04 AM
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);
            }
        }        

0
Justin Crossley
Top achievements
Rank 1
answered on 26 Aug 2009, 11:45 AM
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]");
            }
        }        

0
Freedy Carvalho
Top achievements
Rank 1
answered on 08 Sep 2009, 09:36 PM
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 !


0
Genady Sergeev
Telerik team
answered on 09 Sep 2009, 07:49 AM
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.
0
Michael Rolfes
Top achievements
Rank 1
answered on 25 Sep 2009, 02:07 PM
Do you have an estimate when this fix will be available for release?
0
Matt
Top achievements
Rank 2
answered on 20 Nov 2009, 08:29 PM
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);
            }
        }
0
Majid Darab
Top achievements
Rank 1
answered on 26 Feb 2010, 02:26 PM
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...
0
Majid Darab
Top achievements
Rank 1
answered on 26 Feb 2010, 02:30 PM
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
0
Genady Sergeev
Telerik team
answered on 01 Mar 2010, 09:20 AM
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.
0
Majid Darab
Top achievements
Rank 1
answered on 01 Mar 2010, 10:31 PM
please review my 2 before posts -> IE 8
0
Genady Sergeev
Telerik team
answered on 02 Mar 2010, 09:34 AM
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.
0
VnDevil
Top achievements
Rank 2
answered on 13 Mar 2010, 01:35 PM
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


0
Majid Darab
Top achievements
Rank 1
answered on 14 Mar 2010, 12:46 PM
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
0
Genady Sergeev
Telerik team
answered on 16 Mar 2010, 03:54 PM
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.
0
Majid Darab
Top achievements
Rank 1
answered on 16 Mar 2010, 09:36 PM
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


0
Genady Sergeev
Telerik team
answered on 22 Mar 2010, 01:08 PM
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.
0
Jeff
Top achievements
Rank 1
answered on 28 Apr 2010, 05:18 PM
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
0
Genady Sergeev
Telerik team
answered on 29 Apr 2010, 11:23 AM
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.
0
Matthew
Top achievements
Rank 1
answered on 29 Apr 2010, 04:13 PM
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]".
0
Genady Sergeev
Telerik team
answered on 30 Apr 2010, 04:58 PM
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.
0
HananJ
Top achievements
Rank 1
answered on 30 Nov 2010, 09:23 AM
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 ..!
0
Simon
Telerik team
answered on 06 Dec 2010, 03:34 PM
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.
0
HananJ
Top achievements
Rank 1
answered on 06 Dec 2010, 03:39 PM
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
0
Prajakta
Top achievements
Rank 1
answered on 29 Nov 2011, 06:30 AM
I want some explanation how can i remove fakepath error in chrome using the code.Pl guide
0
Genady Sergeev
Telerik team
answered on 02 Dec 2011, 09:28 AM
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
0
Arefin
Top achievements
Rank 1
answered on 13 May 2013, 09:36 AM
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 ?
0
Genady Sergeev
Telerik team
answered on 15 May 2013, 01:14 PM
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.
0
siva
Top achievements
Rank 1
answered on 17 Apr 2015, 07:42 AM

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">

Tags
Upload (Obsolete)
Asked by
Gary
Top achievements
Rank 1
Answers by
Matthew Bishop
Top achievements
Rank 1
Gary
Top achievements
Rank 1
Erjan Gavalji
Telerik team
Sven
Top achievements
Rank 1
Stacy Draper
Top achievements
Rank 1
Justin Crossley
Top achievements
Rank 1
Freedy Carvalho
Top achievements
Rank 1
Genady Sergeev
Telerik team
Michael Rolfes
Top achievements
Rank 1
Matt
Top achievements
Rank 2
Majid Darab
Top achievements
Rank 1
VnDevil
Top achievements
Rank 2
Jeff
Top achievements
Rank 1
Matthew
Top achievements
Rank 1
HananJ
Top achievements
Rank 1
Simon
Telerik team
Prajakta
Top achievements
Rank 1
Arefin
Top achievements
Rank 1
siva
Top achievements
Rank 1
Share this question
or