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

Open File Question

1 Answer 51 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
Tom
Top achievements
Rank 1
Tom asked on 12 Apr 2011, 10:35 PM
Hello,

I am writing an application in which I want to browse a default UNC path (and subdirectories) to select a file, at which point the file path and name would reside in the text box  (standard text box and button to browse for a file).  I want the allowed file extensions that may be viewed to be CSV,TXT and do not want the user to see any other extensions when browsing for a file.

I do not need to actually upload the file, as my process would be to take the contents of the text box containing the file path and name and store that info into a table (there is a back-end process that will pick up the file and load it).

I am not sure which control to use (asyncupload, upload, or filelocation) since I only need to select the file.

Is there an example of something like what I am attempting to do and a recommendation for the type of control?

Thanks,

1 Answer, 1 is accepted

Sort by
0
Peter Filipov
Telerik team
answered on 15 Apr 2011, 05:24 PM
Hello Tom,

For security reasons browsers don't allow you to take the full file path. It is possible to take only the file name. Also, for the same reasons it is not possible to browse and select a file using javascript. The user should manually select a file from a location. All these are browser's limitations and it is not possible to workaround them.

On the other hand, even If it was possible to grab the path and then save it, please have in mind that this is the path to the file on the client machine. The server is a different machine and this path is not applicable to it. I mean that you can't load the files from the server using the path that was available on the client.

Apart from this, you can use RadAsyncUpload to filter the file choice by setting AllowedFileExtensions property. 

All the best,
Peter Filipov
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.

Tags
AsyncUpload
Asked by
Tom
Top achievements
Rank 1
Answers by
Peter Filipov
Telerik team
Share this question
or