Uploading to a public link via a script?

I think your issue is closely related to this issue over here:

An upload tool for public link shared would be a great additional feature to ease uploads for external users without an account.