PDA

View Full Version : Using (Foxpro) functions filetostr and strtofile in a Webapp



gcjm
2015-11-11, 11:32
Using (Foxpro) functions filetostr and strtofile to read and write a specific file (f.e. e:\xxx\yyy\z.txt) on my server is ok in DeskApp but not in WebApp.
Error message: File not exists. Error number: 15

Is it not possible to use these functions in a Webapp?

Thanks Georg

HankFay
2015-11-11, 15:36
Hi Georg,

filetostr() will run where the code runs, which is on the server, not on the client. Could that be the issue? If so, more details follow.

You can upload a file using networkrequest (http://www.lianja.com/community/showthread.php?1121-File-upload-and-download-in-Lianja) Here's a thread for further reference: http://www.lianja.com/community/archive/index.php/t-3027.html

Note that you can upload a file from the user's desktop into a data file using the Attachments section, and then can run filetostr() on the memofield using mtos() .

hth,

Hank

gcjm
2015-11-11, 16:46
>> filetostr() will run where the code runs, which is on the server, not on the client. Could that be the issue? <<

Thank you, Hank!

The file I want to read / write is (later on) on the server. This time, I check it with the server delivered with the Lianja App Builder. Maybe I should transfer the App to my server?

Bye Georg

HankFay
2015-11-11, 17:42
Hi Georg,

assuming you have deployed the app to the server on the APaaS, and are calling the filetostr() through a call on the server (using Lianja.evaluate() from the JavaScript, or using an .rsp page) there should be no issue.

Hank

gcjm
2015-11-13, 03:13
Thank you Hank, strengthened my intention. Now it's ok.

Maybe the reason was I accessed a shared drive on Linux system (working with Windows in a VirtualBox)

Georg