如何从本地PC获取用于文件上载器控件的Excel文件路径 [英] how to get the Excel file path for file uploader control from local pc

查看:85
本文介绍了如何从本地PC获取用于文件上载器控件的Excel文件路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好


需要使用上载程序控件动态上传excel文件

hi all


need to upload excel file dynamically using uploader control

推荐答案

如果您正在谈论文件路径(如标题所示),则无法使用上载控件获取或设置路径信息-安全性阻止您了解有关客户端计算机的任何信息.浏览器可以控制文件从何处上传,并且不会将其报告给服务器.

如果您试图将上传内容限制为仅特定文件类型(例如* .xls),则必须使用Javascript-此处对此进行了讨论: ^ ]
If you are talking about file paths (as your heading suggests) you cannot get or set path information with Upload controls - security prevents you knowing anything about the client computer. The browser is in control of where files are uploaded from and does not report this to the server.

If you are trying to limit uploads to just specific file types (such as *.xls) then you have to use Javascript - there is a discussion of this here: How to filter files in file upload HTML control[^]


这篇关于如何从本地PC获取用于文件上载器控件的Excel文件路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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