TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Jimmy Mac
NA
4
10.4k
"Cross-Origin Request Blocked" when using jquery file upload
Dec 22 2014 3:52 AM
Hi,
although i assigned for controller as
[EnableCors(origins: "*", headers: "*", methods: "*")]
or
[EnableCors(origins: "*", headers: "x-requested-with, Content-Type, origin, authorization, accept, client-security-token", methods: "*", SupportsCredentials = true)]
or
[EnableCors(origins: "
http://localhost:54189
", headers: "x-requested-with, Content-Type,
origin, authorization, accept, client-security-token", methods: "*")]
for client side, i created a ajax request as below, it doesn't work. The browser occur "Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at
http://localhost:54189/portfolio/upload/
. This can be fixed by moving the resource to the same domain or enabling CORS."
$('#fileupload').fileupload({
url: "
http://localhost:54189/portfolio/upload/
",
multiple: true,
type: "Post",
contentType: 'application/json; charset=utf-8',
crossDomain: true,
headers: { 'Access-Control-Allow-Origin': '*' },
add: function (e, data) {
data.submit();
}
})
What is the error ? Please, share with me if you know something. Thanks.
Reply
Answers (
0
)
Regarding JQuery : Async Function
Signin With google plus