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


Samuel Vanneste

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


decsoft

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.



Samuel Vanneste

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


decsoft

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...



decsoft

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?



Samuel Vanneste

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 :)


decsoft

Hello Samuel,

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 :)

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


Everybody can read the DecSoft support forum for learning purposes, however only DecSoft customers can post new threads. Purchase one or more licenses of some DecSoft products in order to give this and other benefits.

This website uses some useful cookies to store your preferences.

I agree. Hide this note. Give me more information.