Overwriting a file on a server

Charles Warwick charles at techstrategies.com.au
Wed Mar 7 03:49:57 CET 2018


Hi,

> Graham Samuel wrote:
> 
>> However, I don’t seem to be able to mimic what my FTP software
>> (Transmit on the Mac, or FileZilla) can do, which is to easily delete
>> a file on a server  - the file in question is part of a web site
>> hosted by DreamHost. I just want to use the URL functionality to do
>> this, as discussed in my conversation below, but I always get 405
>> (http) or 530 (ftp). I have a vague suspicion that I should be
>> transmitting my credentials to the server, which of course I did when
>> I set up my FTP client, but I have absolutely no idea how to do this.

Using delete via HTTP will generally fail unless the HTTP server and website are specifically configured to allow it (it would usually also require credentials).  Some HTTP APIs do allow the DELETE method.  I expect this is not what you are after. :-)

As you mentioned above, Transmit would be doing this via FTP, but you would need to send your credentials as part of the request.  You can do this with put URL and delete URL (for any supported protocol) by encoding them into the URL that you use like this:

put urlEncode(“username”) into tUser
put urlEncode(“password”) into tPass
put “ftp://“ & tUser & “:” & tPass & “@ftp.mydomain.com/path/to/file.txt” into tUrl

I expect that would likely solve your issue, but as Richard has mentioned, there are security issues to be considered that are all dependant on the environment that you are using your application in.

Cheers.

Charles





More information about the use-livecode mailing list