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

Radupload System.Security.SecurityException

3 Answers 64 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
pat
Top achievements
Rank 1
pat asked on 11 Jul 2017, 03:07 PM

Hello,

i get this exception in the upload process using radupload. Please note that the upload work fine on a win server 2012R2 but was installed 2 years ago by another person and even if i compare both environnement i did not find the reason why the upload return an exception on a fresh install ? any help should be appreciate as i need install the application in a production environnement !

thanks

 

patrick

3 Answers, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 14 Jul 2017, 12:03 PM
Hello Pat,

Can you tell me how exactly you set up the upload control? Some runnable code snippets would be useful for investigating this. 

Keep in mind that Silverlight has some limitations when it comes to working with the file system. One of those is that you can open a file only via a file dialog. So, if you try to open the file without meeting this requirement the reported exception will be thrown.

Regards,
Martin Ivanov
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
pat
Top achievements
Rank 1
answered on 20 Aug 2017, 07:39 AM

Hello Martin,

 

Thanks for the reply and sorry for this late answer.

Yes we work with a file dialog to upload the file.

At the end i just create another radUploadHandler and it works even if the code is more simple ;

new uploadHandler :

public class xxxUploadHandler : RadUploadHandler
    {
    }

old uploadHandler :

public class yyyUploadHandler : RadUploadHandler
    {
        private string newFileName = string.Empty;

        public override Dictionary<string, object> GetAssociatedData()
        {
            Dictionary<string, object> dict = base.GetAssociatedData();
            if (!string.IsNullOrEmpty(newFileName))
            {
                dict.Add("NewFileName", this.newFileName);
            }
            return dict;
        }

        public override string GetFilePath(string fileName)
        {
            fileName = base.GetFilePath(this.GetFileName(fileName));
            return fileName;
        }

        private string GetFileName(string fileName)
        {
            if (this.IsNewFileRequest())
            {
                this.ResultChunkTag = string.Format("_[{0:yyyymmdd_hhmmss}]", DateTime.Now);
            }

            else if (this.FormChunkTag != null)
            {
                this.ResultChunkTag = this.FormChunkTag;
            }

            if (this.ResultChunkTag != null)
            {
                int i = fileName.LastIndexOf('.');
                if (i >= 0)
                {
                    fileName = fileName.Insert(i, this.ResultChunkTag);
                }
            }
            return this.newFileName = fileName;
        }
    }

but i still not understand wy the old uploadhandler doesn't work and throw an security exception as the new one works ?

pat

 

0
Martin Ivanov
Telerik team
answered on 23 Aug 2017, 04:16 PM
Hi Pat,

I tested your upload handler but I wasn't able to reproduce the error. I guess it was some dlls caching or similar issue causing this. However, I am glad that you were able to resolve this on your side.

Regards,
Martin Ivanov
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
General Discussions
Asked by
pat
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
pat
Top achievements
Rank 1
Share this question
or