Radupload System.Security.SecurityException

4 posts, 0 answers
  1. pat
    pat avatar
    3 posts
    Member since:
    Jun 2016

    Posted 11 Jul Link to this post

    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

  2. Martin Ivanov
    Admin
    Martin Ivanov avatar
    1402 posts

    Posted 14 Jul Link to this post

    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.
  3. pat
    pat avatar
    3 posts
    Member since:
    Jun 2016

    Posted 20 Aug in reply to Martin Ivanov Link to this post

    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

     

  4. Martin Ivanov
    Admin
    Martin Ivanov avatar
    1402 posts

    Posted 23 Aug Link to this post

    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.
Back to Top