miyako / 4d-plugin-curl-v3

Generic network client based on libcurl
MIT License
8 stars 0 forks source link

Issue with curl_ftp_send using $2 blob #35

Closed nilskoll closed 2 months ago

nilskoll commented 2 months ago

Hi!

I can't get the syntax with blob as $2 to work. Using a path and READDATA works.. When the document is passed as a blob in $2, the an empty document is created on the sftp server. The (True) branch works, the false doesn't:

` C_BLOB($Document_blob)

If (True) $CurlOptions_object.UPLOAD:=1 $CurlOptions_object.READDATA:=$Document_file.platformPath SET BLOB SIZE($Document_blob; 0) $CurlStatus_object:=cURL_FTP_Send($CurlOptions_object; $Document_blob; $CallbackMethod_text) Else $Document_blob:=$Document_file.getContent() C_OBJECT($CurlStatus_object) $CurlStatus_object:=cURL_FTP_Send($CurlOptions_object; $Document_blob; $CallbackMethod_text) End if `

Version 4D 20.4 LTS build 20.101372 Plugin version 4.8.4 Any suggestions? Thanks in advance!

miyako commented 2 months ago

you have to declare $Document_blob as Blob. otherwise, .getContent() returns 4D.Blob which is a class of Object, not a Blob.

nilskoll commented 2 months ago

The first line is C_BLOB($Document_blob) ? I thought that might be the issue and tested with DOCUMENT TO BLOB, same issue

miyako commented 2 months ago

I need to trace the code to know more.

meanwhile, can you switch to the generic cURL command?

there is no reason to use the FTP command for FTP.

miyako commented 2 months ago

I found the bug, it was a side-effect of supporting files larger than 2GO on Windows.

miyako commented 2 months ago

https://github.com/miyako/4d-plugin-curl-v3/releases/tag/4.8.5

nilskoll commented 2 months ago

Excellent news, however, as far as I can see, the download has version 4.8.4 in both the Test -> Plugin folder and in the curl.dmg. I tested again just to see if it was just the version number not updated, but the issue persist.

miyako commented 2 months ago

I see I uploaded the wrong plugin to releases

miyako commented 2 months ago

also I must have accidentally reverted the code when switching platforms.

miyako commented 2 months ago

please can you try this release

https://github.com/miyako/4d-plugin-curl-v3/releases/tag/4.8.6

nilskoll commented 2 months ago

Yes! Thank you so much for your incredible and quick response. Your service to the 4D developer community is invaluable :)