Skip to content

Uploading a video in a MEDIUM trust environment #1

@mylittletools

Description

@mylittletools

Uploading a video in a medium trust environment fails with the following error:

System.Security.Permissions.SecurityPermission
Exception message: The path is not of a legal form.
Stack trace:    
    at System.IO.Path.NormalizePathFast(String path, Boolean fullCheck)
    at System.IO.Path.NormalizePath(String path, Boolean fullCheck)
    at System.IO.Path.GetFullPathInternal(String path)
    at System.IO.FileInfo..ctor(String fileName)
    at Viddler.Videos.VideosNamespaceWrapper.Upload(String title, String tags, String description, Nullable`1 makePublic, String localPath, Boolean useEndPoint)

Problem comes from the GetMimeType method in ViddlerHelper.cs
It is not possible to link the urlmon.dll in a medium trust environment

Changing the method to

internal static string GetMimeType(Stream fileStream)  {
    return "application/octet-stream";
}

fixes this problem.

Thanks for your great job.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions