libURL and New TsNet Commands/Failures

Charles Warwick charles at techstrategies.com.au
Mon Aug 1 02:02:27 EDT 2016


On 1/08/2016 3:43 pm, Sannyasin Brahmanathaswami wrote:
> @ jacque: It's my understanding that you need to buy the business edition if you want asynchronous connections, even if you are a developer of one.. perhaps I am wrong.

You only need the business edition for async connections using SFTP or 
SMTP(S) protocols.
> @ Charles: thanks for the debug stack.. very useful.  But we have a problem, possible but or need more documention on the "how to…"
>
> I'm getting an "invalid url" from libURL on my test attempts to upload a whole folder
>
> Note that I'm mixing in a
>
> tsNetCreateMissingDirs "true"  # command
>
> because the folders we want to push do not exist.
>
> Use case here is the default WordPress blog/wp-content/uploads folder..and the tool I'm working on will allow bloggers to upload folders of images, the stack then does remote xml/rpc to WP to add a post to the blog… …
>
> so far my test stack is working for fetching listings and uploading single files using simple "put"  and no explicit libURL* commands… so far so good… but put loads the data into memory first. better to use libURL to read the bin file directly  and upload..

If you want to avoid loading the data into memory first, the best 
command for that would be tsNetUploadFileSync.  Let me know if you need 
any help working out the syntax for that.

>   I presumed one must loop through files in a folder to upload a folder as there is no "upload folder" in the dictionary….

Yes, that is right.

>
> So why not with libURLftpUploadFile?
>
> Is it because libURLftpUploadFile  does not understand SFTP?
>
> What am I missing?

You guessed correctly.  :-)

The libUrlFtpUploadFile handler in the standard libUrl library returns 
"invalid url" if it doesn't start with "ftp".

I'll check with the LC team, but it probably makes sense to allow that 
command to work with SFTP as well if it detects the presence of tsNet.

Regards,

Charles





More information about the use-livecode mailing list