Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
145967 | Jul 16,2019 08:57 AM UTC | Aug 1,2019 03:28 AM UTC | React - EJ 2 | 3 |
![]() |
Tags: Uploader |
<httpProtocol>
<customHeaders>
<add name="Access-Control-Allow-Headers"
value="accept, maxdataserviceversion, origin, x-requested-with, dataserviceversion,content-type, chunk-index, Authorization, filePath" />
<add name="Access-Control-Max-Age" value="104857600" />
<add name="Access-Control-Allow-Origin" value="*" />
</customHeaders>
</httpProtocol> |
public openFile(args: any, e: any) {
if (!e.target.classList.contains('e-file-delete-btn') && !e.target.classList.contains('e-file-remove-btn')) {
const ajax = new XMLHttpRequest();
// create new request for open the selected file
ajax.open("POST", 'http://localhost:61835/Home/openFile');
const liElements = document.getElementsByClassName('e-upload')[0].querySelectorAll('.e-upload-file-list') as any;
for (let i = 0; i < liElements.length; i++) {
if (liElements[i].getAttribute('data-file-name') = = = args.file.name) {
// Added the file path in header to get it in server side.
ajax.setRequestHeader('filePath', liElements[i].getAttribute('file-path').toString());
}
}
ajax.send();
}
} |
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.