It is currently 28 February 2021, 4:39 Advanced search

Make new file, load string to file and download? Solved

Questions and answers on how to best use Instant Developer

Make new file, load string to file and download? Solved

Postby john w » 18 December 2020, 17:59

I have a string. I want to load that string into a text file and then allow for the download of the file.

I do not see a way to create a file. None of the objects seem to support the creation of the file only writing and adding to it, etc. Since it would be hard to believe a file cannot be created, I am guessing I missed something.

I then need to allow for a download of the file back the users local pc. Is there a process for that?

Any suggestions will be appreciated.


UPDATE: The solution I found is to use OpenFilexxx procedures. I open the file for output, append the string in and close the file. I do not need to worry about download since its being written to the local drive. The process also makes it easy to keep the same file name and is the app work is handled all in memory. All were target requirements. The file only ever exists on the users hard drive.
Regards

John W
User avatar
john w
 
Posts: 629
Joined: 24 October 2012, 16:29
Location: Apple Valley, Minnesota USA

Re: Make new file, load string to file and download? Solved

Postby r.bianco » 21 December 2020, 7:48

Hi John, OpenFile works in the file system where the application is installed (web server) .
After creating the file, you can serve it via OpenDocument.
only work and no play makes jack a dull boy
r.bianco
 
Posts: 4363
Joined: 8 November 2010, 16:46

Re: Make new file, load string to file and download? Solved

Postby john w » 21 December 2020, 14:17

rB - Then it sounds like my solution will not work. I need to read a file from the users pc process it and deliver it back.

Any suggestions for a process that will work. I cannot store the file on the server, so I need to process it all in memory and make sure the file is deleted.

Thanks!
Regards

John W
User avatar
john w
 
Posts: 629
Joined: 24 October 2012, 16:29
Location: Apple Valley, Minnesota USA


Return to Tips & Tricks

Who is online

Users browsing this forum: No registered users and 2 guests

cron