cancel
Showing results for 
Search instead for 
Did you mean: 

SDK Component create file and write data

hs1
Participant
0 Kudos
93

Hi does somebody know, how create a file inside a SDK Component and write data in it.

In real Java i need binding two file before function.

Java.io.filewriter and  Java.io.IOExeption

I hope somebody know the way to write a file in DS SDK Component

Thanks

Harry

Accepted Solutions (1)

Accepted Solutions (1)

mike_howles4
Active Contributor
0 Kudos

Write a file where?  To the server back-end or the user's PC?

It will be impossible to write to the server back-end without some server component runtime that could communicate via HTTP/REST/AJAX etc to handle requests for writes. I think this is what is referring to when mentioning Node or PHP would be for server-side writes.

If you mean writing to a user's PC, client-side JavaScript (which is basically what the Design Studio SDK is) cannot write to a PC's filesystem.  However, you could invoke a file download dialog with just pure JavaScript.  There are many Open Source libraries that make this a pretty simple job.  I use a JS library called FileSaver to do it.

Answers (1)

Answers (1)

former_member194504
Active Contributor
0 Kudos

Hi Harald,

Yes you can write.

jquery - Is it possible to write data to file using only JavaScript? - Stack Overflow

if you are ok with running some server in Node or PHP, you can use ajax from component to server to write file.

Thanks,

Nithyanandam