Note that there are some explanatory texts on larger screens.

plurals
  1. POSecurity Exception
    text
    copied!<p>I have a web application for upload video and images.In local server that working perfectly.But when i uploaded this to web server there is a error and i can't upload the files.The error is</p> <pre><code>Security Exception Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file. Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. Source Error: The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL: 1. Add a "Debug=true" directive at the top of the file that generated the error. Example: &lt;%@ Page Language="C#" Debug="true" %&gt; or: 2) Add the following section to the configuration file of your application: &lt;configuration&gt; &lt;system.web&gt; &lt;compilation debug="true"/&gt; &lt;/system.web&gt; &lt;/configuration&gt; Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode. Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario. </code></pre> <p>I am using the code for uploading is..</p> <pre><code>Dim connectionstring As String = ConfigurationManager.ConnectionStrings("UploadConnectionString").ConnectionString connection = New SqlConnection(connectionstring) Dim cmd As New SqlCommand("insert into FileM (FileName,[File],FilePath,FileSize)" + "values(@FileName,@File,@FilePath,@FileSize)", connection) cmd.Parameters.Add("@FileName", SqlDbType.NVarChar, buffer.Length).Value = FileUpload1.FileName cmd.Parameters.Add("@File", SqlDbType.VarBinary).Value = buffer cmd.Parameters.Add("@FileSize", SqlDbType.BigInt).Value = file.ContentLength cmd.Parameters.Add("@FilePath", SqlDbType.VarChar).Value = path Using connection connection.Open() Dim i As Integer = cmd.ExecuteNonQuery End Using </code></pre> <p>There have any issue with this type of uploading or want to insert into table via bussiness logic layer?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload