如何使用白名单文件扩展名验证上传文件的扩展名,然后再将其移动到相关文件夹(照片,pdf等) [英] How to validate the extension of uploaded file with white list of file extensions before moving it to the relevant folder (Photos, pdf etc.)

查看:95
本文介绍了如何使用白名单文件扩展名验证上传文件的扩展名,然后再将其移动到相关文件夹(照片,pdf等)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好朋友



你能告诉我如何解决这个问题。



验证扩展名上传文件与

文件扩展名的白名单,然后将其移至相关文件夹(照片,

Order_Circulate等)并删除

文件上传的文件夹。

Hello friend

can you tell me how to fix this problem.

validate the extension of uploaded file with white list of
file extensions before moving it to the relevant folder (Photos,
Order_Circulate etc.) and also remove the execute permissions on the
folders where the files are getting uploaded.

推荐答案

我可能会创建一个DataTable对象,其中包含扩展列表以及它们应该属于哪个文件夹进入。然后我会遍历文件列表,在DataTable中查找他们应该去的地方,并将它们移动到那个位置。



至于你的权限问题...尝试 google [ ^ ]。
I would probably create a DataTable object that holds a list of extensions and which folder they are supposed to go into. Then I would loop through the list of files, look up in the DataTable where they are supposed to go, and move them to that location.

As for your permissions questions...try google[^].


这篇关于如何使用白名单文件扩展名验证上传文件的扩展名,然后再将其移动到相关文件夹(照片,pdf等)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆