上传图片
来源:互联网 发布:阿里云 搭建ss 编辑:程序博客网 时间:2024/05/30 04:39
protected void btn_up_Click(object sender, EventArgs e)
{
if (fup.HasFile && fup.Site < 10)
{
string path = Server.MapPath("~/Upload/");
string filest = Path.GetExtension(fup.FileName).ToLower();
string[] allowedestion = { ".gif", ".jpg", ".jpeg", "png" };
bool tf = false;
for (int i = 0; i < allowedestion.Length; i++)
{
if (filest == allowedestion[0])
{
tf = true;
}
}
if (tf)
{
try
{
fup.PostedFile.SaveAs(path + fup.FileName);
Response.Write("上传成功");
}
catch (Exception ex)
{
Response.Write("上传失败");
}
}
else
{
Response.Write("<script>alert('不支持改格式文件上传');</script>");
}
}
else
{
Response.Write("<script>alert('文件过大');</script>");
}
}
- 图片上传
- 上传图片
- 上传图片
- 上传图片
- 上传图片
- 上传图片
- 图片上传
- 图片上传
- 上传图片
- 上传图片
- 图片上传
- 图片上传
- 图片上传
- 图片上传
- 上传图片
- 上传图片
- 上传图片
- 图片上传
- 关于Foxit Phantom 2.0 Suite 的问题
- ICMP重定向
- 利用JavaMail通过POP3协议、IMAP协议收取Gmail邮箱
- php伪静态介绍
- Ruby编程语言_Chapter02_笔记
- 上传图片
- C语言函数参数调用顺序
- Oracle GoldenGate Veridata Installation and Configuration
- Python3之"IndentationError: unexpected indent"错误
- handler/ runOnUiThread /AsyncTask
- php的类
- 基于字符设备的IIC驱动源代码
- Installing and Configuring GoldenGate Veridata Agent
- 怎样从柱参数值中获取对应的Level对象