Page 1 of 1

First Post-Help on Best Practice for URL Text Files

Posted: Fri Dec 04, 2015 6:36 pm
by J316
Hi Folks,

This is my first posting a question here and thanks for all you are doing to help.

I am reading about retrieving text files that are located on a server, but am not sure what the most efficient way to proceed might be. My app is almost exclusively dealing with text. I have created several fields for displaying the text stored in the field contents, but I'm concerned that with the volume of text I will ultimately have, it may slow down the app. I am not interested (at this point) in writing to the server. In reading, I saw a suggestion of using the "load" command as being asynchronous and also being able to dump the cache. But I also wondered if using FTP would be as good a choice. I'm just too new to this stuff (about a month in) to trust my own instincts.

I have a text file stored on my web server, but forum says I can't post web links. Need help with that for future I suppose?

Might you point me in the direction you think is best for me to proceed? Thanks upfront for any help and again for all you do!

J316

Re: First Post-Help on Best Practice for URL Text Files

Posted: Mon Dec 07, 2015 11:36 pm
by okk
Hi,
one option would be to retrieve the text from your server when opening the stack and putting it into a variable. You have to know your ftp username and password. If it is plain text file-size should not be an issue.

Code: Select all

on OpenStack
  put "ftp://username:password@ftp.example.net/filename.txt/" into downloadfilepath
  put URL downloadfilepath into retrievedtext 
end OpenStack
For larger files you could also use the libURLDownloadToFile command.

best
Oliver

Re: First Post-Help on Best Practice for URL Text Files

Posted: Tue Dec 08, 2015 12:09 am
by J316
Thank you okk! And the best to you also.