36 Answers, 1 is accepted

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

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

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

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
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:
- Add a client-side event handler to the OnClientFileSelected event
- 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
- 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.

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


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);
}
}

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]");
}
}

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.


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);
}
}

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

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

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.


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.

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

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

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.

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 ..!
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

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

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

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

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