0
It is possible to make a request POST
sending a file as parameter?
For example the website of Tinypic contains a field of the type file
, and I want to send a direct image of my application to Tinypic.
0
It is possible to make a request POST
sending a file as parameter?
For example the website of Tinypic contains a field of the type file
, and I want to send a direct image of my application to Tinypic.
0
Yes, it is possible to make POST requests by Javascript using Xmlhttprequest, alias AJAX.
However, it is not possible to send an image to Tinypic that way, because it features Cross-Site Scripting (XSS): you are trying to post a form from an A domain (your website) to a B domain (tinypic). This could only happen if Tinypic included your domain in the header X-Allow-Origin.
There is the possibility to upload images pro Tinypic from your site by service plugin. They put an iframe on your page, then it works, because inside the iframe there is a page with the domain tinypic.com
.
Browser other questions tagged javascript post
You are not signed in. Login or sign up in order to post.
Thanks, clarified my doubt! @rodorgas
– Lucio Rubens