开发者

Submit image in a <form> to a different domain?

开发者 https://www.devze.com 2023-01-06 09:11 出处:网络
I\'ve got a web project where my users signup at a url like: www.mysite.com/signup/index.jsp after the user signs up, I show them another page where they can submit a user photo if they want. But m

I've got a web project where my users signup at a url like:

www.mysite.com/signup/index.jsp

after the user signs up, I show them another page where they can submit a user photo if they want. But my user photos are going to be hosted at another domain I own - is it possible to post a form to another domain? Like the page they land at is here with the following form:

<!--
www.mysite.com/signup/photo.jsp
-->

<form method="POST" action="http://www.myothersite.com/photo.php" >
</form>

I'd ideally like to get the image the user selects to just go to my other domain, where I'll host it statically.开发者_StackOverflow社区 Not sure if something like this is possible due to browser restrictions,

Thanks


is it possible to post a form to another domain

Sure, no problem. There are no cross-domain restrictions, and no single origin policy, for HTML forms.

0

精彩评论

暂无评论...
验证码 换一张
取 消