
I am using RadAsyncUpload control for select a image file from physical path like "D:/Mypicture/pic1.jpeg" and I want to get the full physical path means ‘D:/Mypicture/pic1.jpeg’ but I haven’t get the full path using RadAsyncUpload control.
Below is my code :-
.aspx
<telerik:RadAsyncUpload runat="server" ID=" RadAsyncUpload " ReadOnlyFileInputs="false" Width="225px" MaxFileInputsCount="1" OverwriteExistingFiles="true"> </telerik:RadAsyncUpload>
.cs
foreach (UploadedFile file in RadAsyncUpload.UploadedFiles)
{
String fullpath = file.FileName;
}
Using this code I got only image name i.e. ‘pic1.jpeg’
Please help!
Regards
Ravi
17 Answers, 1 is accepted
You cannot obtain the full client path using RadAsyncUpload. Keep in mind that this is the path on the client machine. Why do you need that on the server? The reason that the client path is not available is that only IE 6 & 7 provide the path. All other browsers provide only the file name of the file selected. Since our goal is to achieve consistent behavior across the different browsers we have decided to stick to the behavior that all major browsers follow.
I see that the IntelliSense shows that FileName returns the fully qualified path on the client. We will fix the message displayed by intellisense so that it reflects the actual functionality.
Kind regards,
Genady Sergeev
the Telerik team

Thank you.
We will address the issue in the next service pack. I've updated your telerik points for the report.
Greetings,
Genady Sergeev
the Telerik team

We have a peculiar requirement for which we need to get the full path of the uploaded files form the async upload. We need to pass the full file path from the client machine to the server, and the server communicates directly to the client through an agent installed in the client system and picks up the files and stored in the server. This actually avoids the limitation of the web content length as we only pass the instruction to the server and the server picks up the files directly from the client through the network.
To achieve this multiple file upload scenario, we have used the async upload control.
Please let me know if there is any way either in the client using javascrips or any other technique from the server side by which we can get the full local path of the file.
Thanks in advance.
Regards,
Ananth
Unfortunately, the full path is no longer provided by the browsers due to a security reasons. The only thing we are given is the file name. Only IE6 and IE7 will provide the full name, all other browser will truncate it to:
1) Only file name (Chrome/Safari)
2) C:\fakepath in IE/Opera
3) Full path displayed - FireFox, however, only filename is sent to the server.
Unfortunately there is nothing we can do in order to change this behavior.
Best wishes,
Genady Sergeev
the Telerik team
Browse the vast support resources we have to jump start 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.


Regards,
Justin

function rAsyncUpload_Selected(sender, args) {
document.getElementById('<%= hidValueFilePath.ClientID%>').value = args.get_fileName();
}
On your RadAsyncUploadControl, set DisabledPlugins="true", and add in:
OnClientFileSelected="rAsyncUpload_Selected"
For your fileuploaded control, you can read the value of your HiddenField to pull out the client's full path.

I also have the same requirement also. I can get the Full path using RadUpload or Stand dard Asp.net file upload control. Unfornuately can't get the same result set using RadAsyncUpload. B/c of Due to some security restrictions.
How is possible it works in other 2 controls except RadAsyncUpload? Is there any other work around (i.e. store the Full Path in Session variable etc???) Below is my code declaration. Thanks
function
RadUpload1_Selected(sender, args)
{
var
upload = $find(
"<%= RadUpload1.ClientID %>"
)
var
filePath = upload.getFileInputs()[0].value;
var
fileName = filePath.substring(filePath.lastIndexOf(
"\\"
) + 1);
alert(filePath);
alert(fileName);
}
function
AsyncUpload_Selected(sender, args) {
var
currentFileName = args.get_fileName();
alert(currentFileName);
}
<telerik:RadUpload ID=
"RadUpload1"
OnClientFileSelected=
"RadUpload1_Selected"
Width=
"500px"
MaxFileInputsCount=
"1"
MaxFileSize=
"50971520"
AllowedFileExtensions=
"csv"
ControlObjectsVisibility=
"RemoveButtons"
runat=
"server"
Skin=
"Silk"
>
</telerik:RadUpload>
<br />
<telerik:RadAsyncUpload runat=
"server"
ID=
"RadAsyncUpload1"
AllowedFileExtensions=
"csv"
MultipleFileSelection=
"Disabled"
DisabledPlugins=
"true"
OnClientFileSelected=
"AsyncUpload_Selected"
MaxFileSize=
"50971520"
Skin=
"Silk"
UploadedFilesRendering=
"BelowFileInput"
>
</telerik:RadAsyncUpload>
As Genady pointed out in his last post only IE6 and IE7 will display the full path while the newer browsers do not allow this for security reasons.
Regards,
Ivan Danchev
Telerik

While in Chrome and Firefox both controls behave identically and do not return the full path, currently the RadAsyncUpload cannot return the full path in IE11, but RadUpload can so if this capability in IE11 is critical in your scenario you can use RadUpload.
Regards,
Ivan Danchev
Telerik

FakePath issue -
RadUpload control - alwayws shows fakepath when trying to access from client side in any browser.
Do we have any solution for this.
Thanks.
The modern browsers do not provide the full path of the uploaded file by the client as that would be a great security vulnerability.
Regards,
Peter Milchev
Progress Telerik

Nothing has changed since Peter's reply earlier this year. Browsers do not let JavaScript touch or know about the file system on the client and this includes paths to files the user chooses to upload.
Regards,
Marin Bratanov
Progress Telerik
