Writing csv file and sending to other server?

Is it possible to write a file and then post that file to another server?

When you say wto csv file, you can import a csv into a dataset or export it as a csv file, similar with Wix Stores as a CSV file.
https://support.wix.com/en/article/importing-data-to-a-database-collection
https://support.wix.com/en/article/importing-products-to-wix-stores

Otherwise, CSV files is not supported by Wix.
https://support.wix.com/en/article/supported-media-file-types-and-file-sizes

I need to automate export from Wix database and send to another server elsewere. Manual import/export is not an option.

If I can write a text file, I can format it as a csv file.

@mike70099 Mike, you cannot write files (from code) in Corvid to disk. Not allowed. But what you can do is this: expose a API with wix-http functions (like “get”) and, when such a request comes in, create this csv-file in memory and hand it over to the calling function. Just make sure you do it in chunks (if many rows to deliver), since there is a 14-seconds time limit on backend functions.

This supposes that the other (calling) server is capable of doing a http-get request and, when rows start coming in, write them to a file.

@giri-zano Thanks. Great suggestion. So, basically by-pass the “open and read.” The problem with that approach in my specific context is that the system I am talking to is quirky (to put it nicely). I’m trying to work around the http API on the other server and use the existing ftp process on the receiving side. They have two very separate processes and I do not think I can do what you suggested. Or, at least, I cannot wrap my head around how to make it work in this specific context, though I totally get the idea. If I had any control over the environment (or even viable documentation) on the receiving server, I might have a prayer of making that work. Sadly, I don’t have either of those things.

Fortunately, I did just discover one solution to one of the server quirks, so I may be back to being able to post individual records using http post, meaning I may not need to try to replicate the ftp process I have been using.

@mike70099 OK, good luck.

@giri-zano Thanks much. For a few reasons, this project has been a slower road than should be necessary. But, I’m making progress every day.