Forum > Pas2JS

Load and Save file

(1/4) > >>

Okoba:
Hello,

Can anyone show me or point me into the direction of how can I make a sample that loads a simple text file (by dropping the file on the page or similar options), change the content and save it again, on the path or output it as downloaded file?

lainz:

--- Quote from: Okoba on August 26, 2023, 11:45:41 am ---Hello,

Can anyone show me or point me into the direction of how can I make a sample that loads a simple text file (by dropping the file on the page or similar options), change the content and save it again, on the path or output it as downloaded file?

--- End quote ---

To load the text file (edit: seems that's using jQuery... you will need to adapt)
https://css-tricks.com/drag-and-drop-file-uploading/
(edit2: seems that they also have the demo without jQuery here view-source:https://css-tricks.com/examples/DragAndDropFileUploading/)

To save to file
https://www.tutorialspoint.com/how-to-create-and-save-text-file-in-javascript

Okoba:
Hey lainz,

I want to do this with Pas2JS and your samples are all in JS.
If there is a link I should know, please tell me as I very new to Pas2JS.

lainz:

--- Quote from: Okoba on August 26, 2023, 01:10:40 pm ---Hey lainz,

I want to do this with Pas2JS and your samples are all in JS.
If there is a link I should know, please tell me as I very new to Pas2JS.

--- End quote ---

Pas2js is JS. Only typed. To code with Pas2JS you should know JS anyways...

Okoba:
I mean how the Pascal code looks? What units should I call and stuff like that.
I am sure that I am missing something, hence asking.
I was thinking there should be a ready sample for such simple task of reading and writing file, so I can check and learn from that.

Navigation

[0] Message Index

[#] Next page

Go to full version