How to read text file through Dropbox
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
How to read text file through Dropbox
Hey everyone
I made a post in the beginners section, but haven't had much luck with it yet . Basically, I want to have a text file in Dropbox/Drive of various events that are happening throughout the month. When an event happens or is updated etc, all I have to do is edit the Dropbox/Drive file, and it'll update. That bit is easy
The issue I'm having is somehow making Livecode read the text file. The best I can do is getting a bunch of html code for the Dropbox/Drive link, but I can't get the actual text into it . I've used this code:
put url "dropboxtextlink" into eventlist
put eventlist into field "events"
That code gives me the massive amount of html code. I've tried looking online, and came across htmltext, so added this code afterwards:
set the htmlText of field "events" to "dropboxtextlink"
I think I'm doing something wrong, because it still doesn't work .
I'm able to upload the file manually to my site and use that link, or have the file from my HDD. The only issue with uploading it to my site is I'd have to do a bit of playing around to add a new file etc, and if it's on my HDD and I'm not near it, I can't change it, which is why I'd much prefer having a file on dropbox etc.
Any suggestions/tips etc etc would be appreciated . Loving Livecode so far, but coming from a VB background (in which I never touched any web stuff), it's a little bit of a challenge
I made a post in the beginners section, but haven't had much luck with it yet . Basically, I want to have a text file in Dropbox/Drive of various events that are happening throughout the month. When an event happens or is updated etc, all I have to do is edit the Dropbox/Drive file, and it'll update. That bit is easy
The issue I'm having is somehow making Livecode read the text file. The best I can do is getting a bunch of html code for the Dropbox/Drive link, but I can't get the actual text into it . I've used this code:
put url "dropboxtextlink" into eventlist
put eventlist into field "events"
That code gives me the massive amount of html code. I've tried looking online, and came across htmltext, so added this code afterwards:
set the htmlText of field "events" to "dropboxtextlink"
I think I'm doing something wrong, because it still doesn't work .
I'm able to upload the file manually to my site and use that link, or have the file from my HDD. The only issue with uploading it to my site is I'd have to do a bit of playing around to add a new file etc, and if it's on my HDD and I'm not near it, I can't change it, which is why I'd much prefer having a file on dropbox etc.
Any suggestions/tips etc etc would be appreciated . Loving Livecode so far, but coming from a VB background (in which I never touched any web stuff), it's a little bit of a challenge
Re: How to read text file through Dropbox
Dear Opaqure,
Thank you for your request.
Try replacing www in your dropbox share link to dl and remove the s in https e.g.
https://www.dropboxusercontent.com/s/p0 ... r/test.txt"
would become
http://dl.dropboxusercontent.com/s/p0qv ... r/test.txt"
This is one method that should allow you to view the text document stored on your dropbox account in LiveCode.
Please feel free to use my supplied link as an example
Kind Regards,
Neil Roger
-----
RunRev Support Team ~ http://www.runrev.com
------
Thank you for your request.
Try replacing www in your dropbox share link to dl and remove the s in https e.g.
https://www.dropboxusercontent.com/s/p0 ... r/test.txt"
would become
http://dl.dropboxusercontent.com/s/p0qv ... r/test.txt"
This is one method that should allow you to view the text document stored on your dropbox account in LiveCode.
Please feel free to use my supplied link as an example
Kind Regards,
Neil Roger
-----
RunRev Support Team ~ http://www.runrev.com
------
Re: How to read text file through Dropbox
Thank you so much! Just a simple fix like that, and suddenly it works perfectly !
Re: How to read text file through Dropbox
thanks you have also solved my problem by your answer...
Re: How to read text file through Dropbox
Hi Neil,
Thanks, that fixed my issue too. A question that arrises from this though. If we are dropping the 's' from the https does that mean that our connection is no longer secure? What are the implications of this method?
Thanks again
Sean Cole
Pi Digital
Thanks, that fixed my issue too. A question that arrises from this though. If we are dropping the 's' from the https does that mean that our connection is no longer secure? What are the implications of this method?
Thanks again
Sean Cole
Pi Digital
Re: How to read text file through Dropbox
I didn't drop the s when I was doing it. I just changed the www to dl and it works for me
-
- Posts: 6
- Joined: Mon Jun 11, 2018 12:20 pm
Re: How to read text file through Dropbox
I know this thread is old, but I give it a try.
This trick works for me, but only in the Livecode environment. It does not work on Windows and Android standalone. Did anyone experience similar behaviour?
I created a simple Stack to test it: A field containing the link, a field that gets the content of the file and a button that updates it. The button has this Skript:
The link I am testing is (without the blanks): http://dl.dropbox. com/s/lnait7te51is82w/FileForDropboxTest.txt?dl=0
The content of it is: "This is the content of the Dropbox file."
Best regards,
Leo
This trick works for me, but only in the Livecode environment. It does not work on Windows and Android standalone. Did anyone experience similar behaviour?
I created a simple Stack to test it: A field containing the link, a field that gets the content of the file and a button that updates it. The button has this Skript:
Code: Select all
on mouseUp
put field "Link" into dropboxLink
put url(dropboxLink) into fileContent
put fileContent into field "Content"
end mouseUp
The content of it is: "This is the content of the Dropbox file."
Best regards,
Leo
Re: How to read text file through Dropbox
Hi Leo,
it works with httpS!
Best
Klaus
it works with httpS!
Code: Select all
...
put url("https://dl.dropboxusercontent.com/s/lnait7te51is82w/FileForDropboxTest.txt?dl=0") into fld 1
...
Klaus
-
- Posts: 6
- Joined: Mon Jun 11, 2018 12:20 pm
Re: How to read text file through Dropbox
Thanks a lot. It seems like I had two problems. First one was the missing "s", second one was the round brackets next to the url command.
This only works inside livecode:
This works everywhere.
I guess I have to take a look into brackets in livecode.
That was a frustrating (and time consuming) problem...
This only works inside livecode:
Code: Select all
put field "Link" into dropboxLink
put url(dropboxLink) into fileContent
Code: Select all
put field "Link" into dropboxLink
put url dropboxLink into fileContent
That was a frustrating (and time consuming) problem...
Re: How to read text file through Dropbox
Hi Leo,
it was the missing S, using brackets, although not neccessary here, also works!
Best
Klaus
it was the missing S, using brackets, although not neccessary here, also works!
Best
Klaus
-
- Posts: 6
- Joined: Mon Jun 11, 2018 12:20 pm
Re: How to read text file through Dropbox
I think I found the gremlin everyone is talking about. It defenitely did not work with the brackets and httpS.
Re: How to read text file through Dropbox
Really?
I tested this on my Mac and it worked as exspected with S AND brackets:
What platform are you on?
I tested this on my Mac and it worked as exspected with S AND brackets:
Code: Select all
...
## I put the HTTPS url into this field:
put field "Link" into dropboxLink
put url(dropboxLink) into fld 2
...
-
- Posts: 6
- Joined: Mon Jun 11, 2018 12:20 pm
Re: How to read text file through Dropbox
I'm on Windows 10. It did not work in the Windows Standalone and Android Standalone.
Re: How to read text file through Dropbox
Hallo leute,
i never use the brackets with this, i do this:
or
By the way, it should not matter on which either platform you are.
Ciao!
Sphere
i never use the brackets with this, i do this:
Code: Select all
put URL "https://verynicewebsite.com" into tT
put tT in Field"dowhatyouwantwiththedata"
Code: Select all
put "https://verynicewebsite.com" into tLink
put URL tLink into tT
put tT in Field"dowhatyouwantwiththedata"
Ciao!
Sphere