zoukankan
html css js c++ java
上传文件夹下的所有文件
因为项目的需要,要实现按目录上传文件,百度了一下
首先,文件夹本身是不能上传的,你只能在service端重建文件夹,这很好办。
上传图片你还要遍历文件夹,如下,里面还可以对图片格式进行限制
System.IO.DirectoryInfo di
=
new
System.IO.DirectoryInfo(Request.MapPath(
"
./uploadfile/
"
));
foreach
(System.IO.DirectoryInfo di1
in
di.GetDirectories())
{
if
(di1.Exists)
{
//
这里写你的上传代码
foreach
(System.IO.FileInfo fi
in
di1.GetFiles())
{
this
.globalmessage.Text
=
fi.Name.ToString();
//
换成你的上传代码
}
}
else
{
this
.globalmessage.Text
+=
"
目录不存在
"
;
}
}
查看全文
相关阅读:
tkinter 类继承的三种方式
tkinter 的两个例子
python 测试驱动开发的简单例子
python 播放 wav 文件
Python 操作 MongoDB
【转】如何拿到半数面试公司Offer——我的Python求职之路
scrapy 保存到 sqlite3
scrapy 爬取 useragent
收集的User-Agent
scrapy 登录
原文地址:https://www.cnblogs.com/xinzhyu/p/799831.html
最新文章
【转】file_get_contents("php://input")的使用方法
【PHP5.3+】获取getCurrentUrl()中 的地址url
【TP3.2】详解_initialize() 和 __construct() 的区别和联系
【jsPDF】jsPDF插件实现将html页面转换成PDF,并下载,支持分页
【laravel5.*】详解laravel中的依赖注入
【laravel5.*】添加ide_helper.php 助手
【centos6】给php命令设置全局变量三种方式
【laravel5.4】php artisan 常用命令
【laravel5.*】运行 php artisan --version报错:PHP Parse error: syntax error, unexpected T_CLASS, expecting T_STRING or T_VARIABLE or '$' in /www/web/crm/artisan on line 31
【php将日志写入一个按时间天来分类的文件】put_file_contents()
热门文章
远程控制软件 mRemoteNG,管理多台虚拟机
Python dict() 函数
python 设计模式之享元(Flyweight)模式
world: 对比两个文档
python 中的 [-1::1] 啥意思
Python 中的 -> 是什么意思
python 设计模式之解释器(Interpreter)模式
python 设计模式之 (Chain of Responsibility)责任链模式
python 设计模式之命令(Command)模式
python 设计模式之迭代器模式
Copyright © 2011-2022 走看看