How do I Request(Ajax) text file content

Get help using Construct 2

Post » Mon Sep 26, 2016 7:38 pm

I'm trying to get the content of a text file using the Ajax plugin and the file is in my google Drive. I do the Request of the link but it always fails.
B
56
S
21
G
3
Posts: 602
Reputation: 6,612

Post » Mon Sep 26, 2016 7:41 pm

I'm afraid this might have to due with the cross-domain request restriction mentioned in the AJAX manual article.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
289
S
112
G
94
Posts: 7,333
Reputation: 69,293

Post » Mon Sep 26, 2016 7:55 pm

@Kyatric

Isn't there any way of doing it? If I store my app on my google drive and try? Would work? Because they are at the same domain.
B
56
S
21
G
3
Posts: 602
Reputation: 6,612

Post » Mon Sep 26, 2016 9:31 pm

Generally the safest way is to include your file as a project file in your capx.

Otherwise you need to have the server your file is located on specifically set up to allow cross domain ajax requests. Which is exactly what the manual entry describes.
Mistakes were made.
B
51
S
25
G
107
Posts: 1,581
Reputation: 60,458

Post » Mon Sep 26, 2016 11:38 pm

@Kyatric

Well, I'm using FileChooser Object. It works but some characters is not loading, like ç , ~ and so on which is non english characters. How can I solve this?
B
56
S
21
G
3
Posts: 602
Reputation: 6,612

Post » Tue Sep 27, 2016 2:20 am

kossglobal wrote:but some characters is not loading, like ç , ~ and so on which is non english characters...


try to save your text file with UTF-8 Encoding

Image
Image
B
65
S
23
G
7
Posts: 1,505
Reputation: 10,896

Post » Tue Sep 27, 2016 2:52 am

korbaach wrote:
kossglobal wrote:but some characters is not loading, like ç , ~ and so on which is non english characters...


try to save your text file with UTF-8 Encoding

Image

Thank you.
B
56
S
21
G
3
Posts: 602
Reputation: 6,612


Return to How do I....?

Who is online

Users browsing this forum: Lancifer and 14 guests