看看你的FORM里面有没给form 指定enctype 属性
解决方案 »
- asp.net 顺丰单号接口
- json问题
- 命令按钮中取Gridview中的行数为0,为什么?
- 那出现visual studio2005下调试后出现“localhost:2301/index.aspx ”是不是正常的啊,若错误,怎样修改呢
- 为什么我的站点在本地测试没有任何问题,但上传到站点就出问题了?
- 大哥大姐,如何在ASP.net 出现一个可以选择Yes 和 no 的MessageBox对话框,分不多见谅.
- 还是关于动态生成控件绑定处理方法的问题
- 百度地图API未授权,这是什么问题啊!!!!!!!!-100分都给了
- 请教:可否在编程中动态加载页面样式表文件?
- 急!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- 请帮帮我吧,关于Parameters的问题
- 我输入的字符中的回车为什么会不见了?急!!!
HttpPostedFile upFile =up_file.PostedFile;
int iFileLength = upFile.ContentLength;
改成:
int iFileLength = up_file.PostedFile.ContentLength;
在.aspx文件中:(添加enctype="multipart/form-data")
<form id="Form1" method="post" runat="server" enctype="multipart/form-data">在.aspx.cs中:
using System.IO;
<%@ Page language="c#" Codebehind="default.aspx.cs" Inherits="MobileWebApplication17.MobileWebForm1" AutoEventWireup="false" %>
<HEAD>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" content="C#">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/Mobile/Page">
</HEAD>
<body Xmlns:mobile="http://schemas.microsoft.com/Mobile/WebForm">
<mobile:Form id="Form1" enctype="multipart/form-data" runat="server">
<FONT face="宋体">
<mobile:Label id="Label1" runat="server" Alignment="Center" Font-Name="Arial">图片上传系统</mobile:Label>
<mobile:Label id="Label2" runat="server">请输入要上传编号:</mobile:Label>
<mobile:TextBox id="TextBox1" runat="server"></mobile:TextBox>
<mobile:Label id="Label3" runat="server">请选择要上传的图片:</mobile:Label>
<mobile:Command id="Command1" runat="server">上传</mobile:Command> </FONT>
<mobile:Panel id="Panel2" runat="server">
<asp:Panel id="Panel1" runat="server">Panel<BR>
<BR>
<INPUT id="up_file" type="file" name="up_file" runat="server">
<BR></asp:Panel>
</mobile:Panel>
</mobile:Form>
</body>去掉enctype="multipart/form-data",还是错的,,
我现在用的是移动控件,在做移动asp.net的项目,遇到麻烦了,希望大家可以帮我,谢谢!