文件中的网页上传的编程设置名称 [英] Programmatically set name of file to upload in webpage

查看:87
本文介绍了文件中的网页上传的编程设置名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种方法以编程方式设置为从网页上载的文件的名字?我怀疑是浏览器的安全限制使得这个不可能的,但我希望有人会证明我错了。

Is there a way to programmatically set the name of a file to be uploaded from a web page? I suspect that browser security restrictions make this impossible, but I'm hoping someone will prove me wrong.

我有需要让管理员上传HTML的Web应用程序。管理员选择HTML文件,然后将应用程序上传这个文件,再加上计算出所有的支持文件(图片,样式表等),并上传他们太多。似乎没有要以编程方式上传从网页支持文件的一种方式,因为用户必须明确指定每个文件。

I have a web application that needs to let the administrator upload HTML. The admin selects the HTML file, then the app uploads that file, plus figures out all the supporting files (images, stylesheet, etc) and uploads them too. There doesn't seem to be a way to programmatically upload the supporting files from a web page, since the user has to specify each file explicitly.

目前我有一个单独的Windows应用程序要做到这一点,但它会是理想的具有此功能与应用程序的其余部分集成在一起。我的后台是ASP.NET与C#。

Currently I have a separate Windows app to do this, but it would be ideal to have this functionality integrated with the rest of the app. My back end is ASP.NET with C#.

推荐答案

有没有办法通过浏览器以编程方式抓住从用户的计算机文件。这将是安全冲突,如果一个网站可能只是抓住的东西。

There is no way to programatically grab files from a user's computer via the browser. This would be a security violation if a website could just grab things.

这篇关于文件中的网页上传的编程设置名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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