まあ、私は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());
}
あなたのコメントは以下です。両方のページで使用している*実際のコードを投稿して、このフォームを入力しているページの種類を共有してください。 –
enctypeがあれば、何が起こるのですか? –
Request.Files [0]にアクセスすると、ファイルがないため、インデックスが配列の境界外にある –