日期:2014-05-18  浏览次数:20683 次

图片上传问题请指教~!
<table width="160" border="0" cellspacing="0" cellpadding="2">
  <tr>
  <td height="120" align="center" style="border: 1px solid #133580;">
  <img id="Image1" height="0" width="0" onload="javascript:DrawImage(this);" alt="" src=""/>&nbsp;
  <asp:Image ID="TitleImg" runat="server" Height="107px" Width="183px" />
  <asp:TextBox ID="delpic" runat="server" Visible="true" Text="-1" Height="0px" Width="0px"></asp:TextBox></td>
  </tr>
  <tr>
  <td>
  <asp:FileUpload ID="FileUpload1" runat="server" Font-Size="9pt" onchange="javascript:FileChange(this.value);" style="margin-left:-135px;" /> 
   
  <input style="HEIGHT: 20px" onclick="javascript:FileChange('');" type="button" value="清除" />
  </td>
  </tr>
  </table>
  FileStream fs = null;
  byte[] imageb = null;
  if (delpic == 0)
  {

  fs = File.OpenRead(FileUpload1.PostedFile.FileName);
  imageb = new byte[fs.Length];
  fs.Read(imageb, 0, imageb.Length);
  fs.Close();
  }
<?xml version="1.0"?>
<configuration>
<system.web>
<authentication mode="Windows"/>
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm"/>
<error statusCode="404" redirect="FileNotFound.htm"/>
</customErrors>
  <httpHandlers>
<add verb="GET" path="*.axd" type="System.Web.Handlers.AssemblyResourceLoader" /> 
<add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" validate="false" />
</httpHandlers>
  <compilation debug="false">
<buildProviders>
  <add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.Common, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</buildProviders>
<assemblies>
<add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/&