在ASP.NET后得到的数据文件上传数据 [英] Get file upload data from post data in ASP.NET
问题描述
我通过以做他们的东西窗体上公布值循环(所以不要访问控件本身)。这是这个过程我必须承担这个项目,所以这就是为什么我做这种方式。
I am looping through the posted values on a form with a view to doing something with them (so don't have access to the controls themselves). This is the process I have to take on this project so that is why I'm doing it this way.
在表单我将有一个文件上传框,但我不知道我会如何上传已经从它选择的文件,因为我不能只是做 Control.SaveAs()
。当我使用的返回值公布 Request.Form.Item [I]
我得到的文件名我选,但不像我期望的完整路径。
On the form I will have a file upload box but I am not sure how I would upload the file that has been selected from it as I can't just do Control.SaveAs()
. When I return the posted value using Request.Form.Item[i]
I get the file name I chose but not the full path like I would expect.
有人能指出我朝着正确的方向吗?
Can someone point me in the right direction please?
感谢。
推荐答案
如果你想直接操纵上传的文件,而不是通过FileUploader控制,你应该使用 Request.Files
集合,而不是的Request.Form
If you want to manipulate the uploaded files directly, and not through a FileUploader control, you should use the Request.Files
collection and not the Request.Form
这篇关于在ASP.NET后得到的数据文件上传数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!