好吧,我在domain1工作。我需要将文件上传到domain2。在我DOMAIN1 ASPX我有(外主):如何将文件上传到另一个aspx文件?
<div id="divCurriculo">
<form id="frmCurric" enctype="multipart/form-data" action="http://reports.programacontactosonae.com/uploadcv.aspx" method="post">
<input type="hidden" name="userid" value="284" />
<table>
<tr>
<td class="first">
<label>Currículo</label>
</td>
<td>
<input type="file" id="filecv" style="display:inline-block;" />
<input type="submit" value="Enviar" style="width:70px;display:inline-block;" />
</td>
<tr>
</table>
</form>
</div>
所以,我需要什么,我接收文件中域2来获取文件?这是我有:
protected void Page_Load(object sender, EventArgs e)
{
string userid = Request.Form["userid"];
Response.Write(userid + "<br />"); // i catch, successfully, the value in the hiddenfield
HttpPostedFile file = Request.Files[0];//here i get an error cause it can't find any file
Response.Write(file.ToString());
}
根据您的评论如下;请在这两个页面上发布您正在使用的*实际*代码,并分享您要将此表单输入的页面的种类。 – 2010-12-18 19:02:44
如果您有应该工作的enctype;怎么了? – 2010-12-18 19:07:28
当我访问Request.Files [0]我得到的索引超出了数组的边界,因为没有文件 – 2010-12-18 19:18:47