Hi Graham, > On 5 Mar 2018, at 11:04 pm, Graham Samuel via use-livecode > <email@example.com> wrote: > > Another dumb question, I’m afraid. The dictionary says I can do > > put tdata into URL [some url] > > well, I want to put a file on my server (in this example, it’s a text file) > to replace one of the same name. If I just try to steamroller it by ignoring > the existing file, I get a ‘405’ error (forbidden method, I think). If I use > an FTP client like Transmit, I get a warning about overwriting the file and a > manual override. > > How can I grow my own, by detecting the existing file and then overwriting it > anyway? Should I delete the existing file as a separate operation? How can I > be sure I have enough permission to do so?
You can use ‘delete URL’ to delete an FTP file. If the result is not empty, then it failed to delete it. You could always try the ‘put’ first, and if you get a 405 error, try the ‘delete’. If the delete is successful, you can ‘put’ again. If the delete is unsuccessful, advise the user. Cheers, Charles _______________________________________________ use-livecode mailing list firstname.lastname@example.org Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode