I am building a routine that gets an order number from a text file on a server through FTP, increments that order number then saves the new, incremented order number back to the file.
I am stuck on the saving part. Here is my basic code. It gets the correct data out of the file, increments it but how do I put the new order number back?
put "ftp://"&" UNAME "&" : "&" PW "&"@"&" IP "&"/test/System Numbers" into tFolder
put (tFolder & "/" & sPoint) into nFile
put url nFile into tNumber
add 1 to tNumber
put (sCode & tNumber) into line 1 of url nFile
This was the only similar post I could find but there was no solution that worked and the responses stopped in 2010.
Hi Jack,
Unless you have some cool php, cgi or a liveCode server I don't think just FTP is what you want.
If the file was small enough and wasn't being requested by multiple users then I'd download the file, update it locally then upload it again.
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
It is a tiny file (4kb's) but I do have multiple users accessing it.
Currently it is working as we mount the server using AFP then uses a Open, Write and Close process on the file. I wanted to try mimic that so we can move to mobile devices.
I think I will try using a php script to do it server side.
Hi Jack,
This actually sounds like a job for mySQL, if you haven't worked with DB's this would be a great start. Simple DB, the most difficult part would be setting up the original DB on your server and cPanel can do most of that.
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!