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

Long filename problem

3 Answers 98 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Harry
Top achievements
Rank 1
Harry asked on 15 Apr 2010, 08:59 AM
I got a weird problem with filexplorer. After uploading files with a long filename the files are stored without a problem on the server (filename is correct) but when you try to view those files with fileexplorer the filenames are truncated at the second occuring blank in the filename. The full length of the path and filename is approx. 140 characters.

e.g.
Z:\Websites\xxxxxxx.xxxxxxxx.xx\html\clients\xxxxx\an xxxxxxxx\Regalbeschriftungen\Regalb Buch RGM 7430+7431+7432.doc
works without a problem

Z:\Websites\xxxxxxx.xxxxxxxx.xx\html\clients\xxxxx\an xxxxxxxx\Regalbeschriftungen\Regalbeschriftung Buch RGM 7430+7431+7432.doc
shows as "Regalbeschriftung Buch"

any ideas ?

3 Answers, 1 is accepted

Sort by
0
Dobromir
Telerik team
answered on 20 Apr 2010, 02:36 PM
Hi Raffael,

We are not aware of such problem and I was unable to reproduce it on our side. Could you please open a support ticket and attach a simple runnable project that reproduces the problem so we can investigate it further?

On a side note, by design RadGrid (the grid component of RadFileExplorer) truncates the file name so it can fit into the cell. Could you try to resize the cell to see if it still displays truncated name?

For your convenience I have uploaded a movie demonstrating my test using standard RadFileExplorer configuration.

Best wishes,
Dobromir
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
Harry
Top achievements
Rank 1
answered on 20 Apr 2010, 10:29 PM
Thanks for your reply,
I found that the + chars in the filename are a problem when opening files via java script ....
the Handler.ashx only gets the full filename without any +
RGM 7430+7431+7432.doc will be RGM 7430 7431 7432.doc ... which produces an error ...

Do I need to urlencode item.get_url() ?

    <script type="text/javascript">  
        //<![CDATA[
        function buttonSubmit_Click() {
            var oExp = $find("<%= RadFileExplorer1.ClientID %>");
            var wm = GetRadWindowManager();
            wm.closeAll();
        }
        function OnClientFileOpen(oExplorer, args) {
            var item = args.get_item();
            var fileExtension = item.get_extension();
            if (!item.isDirectory()) {
                args.set_cancel(true);
                var requestImage = "Handler.ashx?path=" + item.get_url();
                document.location = requestImage;
            }
        }
        //]]> 
    </script> 
0
Harry
Top achievements
Rank 1
answered on 20 Apr 2010, 10:51 PM

Fixed it ...

                var requestImage = "Handler.ashx?path=" + encodeURIComponent(item.get_url());  
                document.location = requestImage;  
 

you should update your example file to include encodeURIComponent ... you'll never know what crazy filenames people are using .. especially MAC USERS (how I hate them) !

PS: Continue this brilliant work !
Tags
FileExplorer
Asked by
Harry
Top achievements
Rank 1
Answers by
Dobromir
Telerik team
Harry
Top achievements
Rank 1
Share this question
or