Click here to Skip to main content
15,881,781 members
Home / Discussions / JavaScript
   

JavaScript

 
AnswerRe: Want to download a zip file that's returned as FileStreamResult only, I could able to download in-memory using byte array but Pin
jkirkerx21-Oct-19 12:11
professionaljkirkerx21-Oct-19 12:11 
GeneralRe: Want to download a zip file that's returned as FileStreamResult only, I could able to download in-memory using byte array but Pin
simpledeveloper21-Oct-19 13:16
simpledeveloper21-Oct-19 13:16 
GeneralRe: Want to download a zip file that's returned as FileStreamResult only, I could able to download in-memory using byte array but Pin
jkirkerx22-Oct-19 7:21
professionaljkirkerx22-Oct-19 7:21 
GeneralRe: Want to download a zip file that's returned as FileStreamResult only, I could able to download in-memory using byte array but Pin
simpledeveloper22-Oct-19 8:56
simpledeveloper22-Oct-19 8:56 
GeneralRe: Want to download a zip file that's returned as FileStreamResult only, I could able to download in-memory using byte array but Pin
jkirkerx23-Oct-19 6:55
professionaljkirkerx23-Oct-19 6:55 
GeneralRe: Want to download a zip file that's returned as FileStreamResult only, I could able to download in-memory using byte array but Pin
simpledeveloper24-Oct-19 13:25
simpledeveloper24-Oct-19 13:25 
Questionhas been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource Pin
simpledeveloper15-Oct-19 13:05
simpledeveloper15-Oct-19 13:05 
AnswerRe: has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource Pin
jkirkerx15-Oct-19 13:54
professionaljkirkerx15-Oct-19 13:54 
I don't think it has anything to do with the code you posted.

CORS means Cross Origin Request. It's a security feature that secures your API's access and is part of the API server and your code in React. It prevents someone from spoofing your API's

https://medium.com/@dtkatz/3-ways-to-fix-the-cors-error-and-how-access-control-allow-origin-works-d97d55946d9

I have an Angular Project wrapped in .Net Core which hosts the API's in a controller. Technically my project is using Kestrel as a web server. Kestrel is a lightweight blazing fast web server which will serve .Net Projects. In my case, I had to fully program Kestrel as a web server in Programs.cs and Startup.cs, and then align my Angular project to the API's so that I don't get a CORS error. So like services.AddCors is what you add to startup.cs. I had to do a few other things in Angular to get things to align as well. And write some code to handle developing in VS using localhost:5000 to the actual production URL.

I don't know how you structured your React application and back-end API so I'm not able to answer the question as a code fix.

At some point in time, your going to have to figure out how to handle SSL certificates, setup Kestrel and listening ports in .Net Core if that is what your using. You will have to figure out how to host it in a production environment.
If it ain't broke don't fix it
Discover my world at jkirkerx.com

AnswerRe: has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource Pin
F-ES Sitecore15-Oct-19 22:14
professionalF-ES Sitecore15-Oct-19 22:14 
AnswerRe: has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource Pin
simpledeveloper16-Oct-19 7:10
simpledeveloper16-Oct-19 7:10 
QuestionTrying to download Zip files that's returned from Api React Pin
simpledeveloper14-Oct-19 9:00
simpledeveloper14-Oct-19 9:00 
AnswerRe: Trying to download Zip files that's returned from Api React Pin
Richard Deeming14-Oct-19 9:38
mveRichard Deeming14-Oct-19 9:38 
GeneralRe: Trying to download Zip files that's returned from Api React Pin
simpledeveloper14-Oct-19 11:45
simpledeveloper14-Oct-19 11:45 
GeneralRe: Trying to download Zip files that's returned from Api React Pin
Richard Deeming15-Oct-19 1:24
mveRichard Deeming15-Oct-19 1:24 
GeneralRe: Trying to download Zip files that's returned from Api React Pin
simpledeveloper15-Oct-19 6:31
simpledeveloper15-Oct-19 6:31 
GeneralRe: Trying to download Zip files that's returned from Api React Pin
simpledeveloper15-Oct-19 8:59
simpledeveloper15-Oct-19 8:59 
GeneralRe: Trying to download Zip files that's returned from Api React Pin
Richard Deeming16-Oct-19 7:49
mveRichard Deeming16-Oct-19 7:49 
GeneralRe: Trying to download Zip files that's returned from Api React Pin
simpledeveloper17-Oct-19 6:53
simpledeveloper17-Oct-19 6:53 
GeneralRe: Trying to download Zip files that's returned from Api React Pin
Richard Deeming17-Oct-19 7:12
mveRichard Deeming17-Oct-19 7:12 
GeneralRe: Trying to download Zip files that's returned from Api React Pin
simpledeveloper17-Oct-19 11:40
simpledeveloper17-Oct-19 11:40 
GeneralRe: Trying to download Zip files that's returned from Api React Pin
Richard Deeming18-Oct-19 1:12
mveRichard Deeming18-Oct-19 1:12 
GeneralRe: Trying to download Zip files that's returned from Api React Pin
simpledeveloper20-Oct-19 14:38
simpledeveloper20-Oct-19 14:38 
GeneralRe: Trying to download Zip files that's returned from Api React Pin
simpledeveloper21-Oct-19 8:08
simpledeveloper21-Oct-19 8:08 
GeneralRe: Trying to download Zip files that's returned from Api React Pin
simpledeveloper21-Oct-19 10:09
simpledeveloper21-Oct-19 10:09 
AnswerRe: Trying to download Zip files that's returned from Api React Pin
simpledeveloper21-Oct-19 8:10
simpledeveloper21-Oct-19 8:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.