web配置错误无法在asp.net上的服务器上上传文件

时间:2015-07-16 07:38:46

标签: asp.net web-config

我正在使用下面的web配置上传服务器asp.net 4.0中的文件,但我收到错误重新分级,这是我的web配置代码怎么办?

<?xml version="1.0"?>
<configuration>

  <system.webServer>
     <validation validateIntegratedModeConfiguration="false"/>
  </system.webServer>
  <system.web>
 <authentication mode="Windows"/>
 <identity impersonate="true" />

    <compilation debug="true" targetFramework="4.0">
      <assemblies>
        <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
        <add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
      </assemblies>
    </compilation>
    <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/>

    <sessionState timeout="1000" regenerateExpiredSessionId="true">

    </sessionState>

<customErrors mode="Off" />
<machineKey validationKey="1234567890123456789012345678901234567890AAAAAAAAAA"
 decryptionKey="123456789012345678901234567890123456789012345678"
 validation="SHA1" decryption="Auto" />


</system.web>
  <connectionStrings>
   <add name="cityxisConnectionString" connectionString="Data Source=66.63.181.66;Initial Catalog=testdb;User ID=testadmin;Password=Trial@!789" providerName="System.Data.SqlClient"/>


    <add name="myConnectionString" connectionString="Data Source=192.168.1.1;Initial Catalog=temp;User ID=temp;Password=temp" providerName="System.Data.SqlClient"/>


  </connectionStrings>
<system.webServer>
    <handlers>
      <add name="AjaxFileUploadHandler" verb="POST" path="AjaxFileUploadHandler.axd" type="AjaxControlToolkit.AjaxFileUploadHandler, AjaxControlToolkit"/>
    </handlers>
  </system.webServer>

</configuration>

但我无法在服务器错误上传文件

  Access to the path 'E:\domains\mywebsite.co.in\httpdocs\cover\3128.jpg' is denied.

    FileUpload1.SaveAs(Server.MapPath("/cover/" + Session["upkey"].ToString() + fileName)); 

0 个答案:

没有答案