VB.Net自动填充文件上传Web表单 [英] VB.Net Auto-Fill File Upload Webform
问题描述
我正在寻找一种使用VB.Net通过现有Web表单上载多个文件的方法.我没有访问实际服务器的权限,所以我不能那样做.我知道如何获取文件上传HTML元素并提交表单;但是,我不知道如何设置要上传的文件.
我已经尝试过在这个主题上进行广泛的Google搜索,但是我所获得的只是如何使用ASP.Net设置批处理上传器"
任何帮助将不胜感激,即使稍后我可能会在额头上sm自己;-)
Ethan
I am looking for a way to use VB.Net to upload several files through an existing web-form. I do not have access to the actual server so I cannot do it that way. I know how to get the File Upload HTML element and Submit the form; however, I do not know how to set the file I wish to upload.
I have tried extensive Googling on this topic, but all I get is "How to set up a batch uploader with ASP.Net"
Any help would be appreciated, even though I will probably be smacking myself on the forehead later ;-)
Ethan
推荐答案
您可以尝试以下javascript想法:
Hi,
You can try this javascript idea:
function funcAutofillUploadForm() {
var uploadctrl = document.getElementById('MainContent_fuControl');
var inputCtrl = uploadctrl.outerHTML;
}
现在,inputCtrl将包含类似以下内容的内容:
Now, inputCtrl would hold something like:
<INPUT id=MainContent_fuControl type=file value=ertterth name=ctl00
MainContent
MainContent
fuControl >
fuControl>
您只需要找到一种方法即可用路径替换值部分.
You just have to find a way to replace the value part with your path.
这篇关于VB.Net自动填充文件上传Web表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!