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

[Solved] ImageBrowser supported file types

7 Answers 97 Views
Editor
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Stefan
Top achievements
Rank 1
Stefan asked on 23 Dec 2011, 10:11 AM
Hello, 

Is there a possibility to extend the list of file types which can be uploaded with the ImageBrowser ? At the moment it seems that only png, gif, jpg and jpeg can be uploaded.

thanks

7 Answers, 1 is accepted

Sort by
0
Stefan
Top achievements
Rank 1
answered on 09 Jan 2012, 08:34 AM
Hello again,

Is there any solution to this ? As a requirement from the client I have to support more file types, so I would really appreciate any help.

thanks
0
Georgi Tunev
Telerik team
answered on 09 Jan 2012, 02:51 PM
Hello Stefan,

You can use the .Filter() method for this purpose - set the allowed file types as a string in it:

.FileBrowser(t => t.Browse("Browse", "ImageBrowser")
            .Filter("*.png,*.gif,*.jpg,*.jpeg,*.jpe")
               .Thumbnail("Thumbnail", "ImageBrowser")
               .Upload("Upload", "ImageBrowser")
               .DeleteFile("DeleteFile", "ImageBrowser")
               .DeleteDirectory("DeleteDirectory", "ImageBrowser")
               .CreateDirectory("CreateDirectory", "ImageBrowser"))
        .Render();


Kind regards,
Georgi Tunev
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 Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
0
Stefan
Top achievements
Rank 1
answered on 09 Jan 2012, 04:13 PM
Hello,

Now no error message regarding the file formats is displayed, but now the Upload Method, which I have overwritten, is not called. Although it works with the image formats.

Thanks
0
Georgi Tunev
Telerik team
answered on 10 Jan 2012, 10:40 AM
Hello again Stefan,

 In such case I would like to ask you to send a sample project that shows your implementation so we can check it.

Kind regards,
Georgi Tunev
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 Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
0
Stefan
Top achievements
Rank 1
answered on 11 Jan 2012, 10:52 AM
Hello Georgi,

I am sending you the test project. To reproduce the problem please uncomment the .Filter .... method in the Index.aspx File. In our project we use the imagebrowser together with the editor or as well stand alone. We have several customers and they have tenants. So the imagebrowser provides the necessary interfaces for Authorizing the operations. As well we have to upload videos. There of course we have to use the imagebrowser stand alone. As written in the previous comment when I permit other formats( i tested that with a wmv file ) the Upload method is never called. So how could I change that behaviour ?

thank you

0
Petur Subev
Telerik team
answered on 13 Jan 2012, 03:17 PM
Hi Stefan,

One of the reasons not to reach the Upload controller is probably because you did not configure your application to accept larger files which are posted.
i.e.
<configuration>
    <system.web>
        <httpRuntime maxRequestLength="32768" />//32MB
    </system.web>
</configuration>
Also make sure you override the authorization methods as mentioned in our documentation.


All the best,
Petur Subev
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 Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
0
Stefan
Top achievements
Rank 1
answered on 13 Jan 2012, 03:50 PM
Hi Petur,

Yes, this was solving the problem.

Thanks
Tags
Editor
Asked by
Stefan
Top achievements
Rank 1
Answers by
Stefan
Top achievements
Rank 1
Georgi Tunev
Telerik team
Petur Subev
Telerik team
Share this question
or