#1 2016-10-01 17:30:35

svanneste
Member
From: Paris, France
Registered: 2015-05-27
Posts: 155

[SOLVED] How can we dowload some file's content ?

Hello,
How could we download some file content without any CORS error, please ? I have tried using SimpleGET and a HttpClient. Are we sticked not being able to download any content ? Sample app : [removed]

Many thanks

down.png

Last edited by svanneste (2016-10-01 17:48:24)

Offline

#2 2016-10-01 17:32:58

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,661
Website

Re: [SOLVED] How can we dowload some file's content ?

Hello Samuel,

CORS is not something imposed by App Builder, but by browser's vendors. What's the problem to enable the appropiate CORS in your server side? If you want to access to some thirdparty services (so you may can't enable the CORS permissions) you always can provide a bridge between your app and the thirdparty server using your own server scripts.

Also, if you want to download something like a "TXT" file (so we can't use the PHP stuff to enable the CORS permissions) you can always use something like an "htaccess" file (if you use the Apache HTTP server) to enable the CORS permissions for that "TXT" file.

Offline

#3 2016-10-01 17:46:31

svanneste
Member
From: Paris, France
Registered: 2015-05-27
Posts: 155

Re: [SOLVED] How can we dowload some file's content ?

Hello David,
Thanks for your reply.

My need is to access some resource on the local network (a playlist file generated by my provider's router). That's the reason why I can not create a web service on the server's side or a bridge from the internet to the local file. The example provided was for testing only.

The good point, thanks for your explanation is that if I compile a platform app, I should be able to access without the CORS restriction.

Thanks for your excellent support, David

Offline

#4 2016-10-01 17:49:53

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,661
Website

Re: [SOLVED] How can we dowload some file's content ?

Hello Samuel,

Sorry, but I can't understand very well... honestly I am not an expert in local networks. The point is if an HTML application can access to a resource like that: not only an App Builder application, since the environment (the browser) in which the application is running.

Maybe I am stupid if I suggest you to include the resource file as one of your application files... I supose the resource file can be updated or something like that, once your application has been deployed. Certainly I am not sure what to say Samuel...

Offline

#5 2016-10-01 17:51:36

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,661
Website

Re: [SOLVED] How can we dowload some file's content ?

Hello Samuel,

Setup an HTTP server it's not something complicated nowadays, so, what if you think to place the resource file in an HTTP server running in the application machine? Are this completely wrong?

Offline

#6 2016-10-01 19:31:48

svanneste
Member
From: Paris, France
Registered: 2015-05-27
Posts: 155

Re: [SOLVED] How can we dowload some file's content ?

Well those are good ideas. But I will give up on that project using AB because I get erratic behaviors like downloading the playlist allowed one time and not others. Probably a problem on my whole installation. I will have to check that closer.
Thanks again for your support smile

Offline

#7 2016-10-01 19:45:31

David
Admin
From: Alcobendas, Madrid, Spain
Registered: 2015-04-21
Posts: 1,661
Website

Re: [SOLVED] How can we dowload some file's content ?

Hello Samuel,

svanneste wrote:

Well those are good ideas. But I will give up on that project using AB because I get erratic behaviors like downloading the playlist allowed one time and not others. Probably a problem on my whole installation. I will have to check that closer.
Thanks again for your support smile

No problem, sir. Please let me know if you have any further question. wink

Offline

Board footer

Powered by FluxBB


Copyright ©2018 DecSoft. All rights reserved.