4d-plugin-curl-ftp

I use the latest version of 4d-plugin-curl-ftp and when I use cURL_FTP_Delete I always get an error.

If I change to the old version everything is going well.

Has there been any change in programming?

4D V18. Windows 10.

:?:

please be more specific when referring to a version, “latest” or “old” is not good enough.

also, if you want someone (remember the project is open source, anybody can contribute) to help,

you should open an “issue” on GitHub and you should consider sharing reproducible example code.

Sorry

:pray:

Old Version: 2.18 11 jun 2019

Latest: 27 days Ago. The last one in Github.

Thank you

what is the protocol?

FTP, SFTP, FTPS

different servers respond differently to certain requests, so if you can’t provide a working example,

could you please at least share the file path?

Protocol FTP

<code 4D>
$URL:=<>IPFTP+"/"+<>CPwebesquerra+"/"+[Comunicats]NomDocument+".html"
OB SET($options;“URL”;$URL;“USERNAME”;<>Usuari;“PASSWORD”;<>Contrasenya)
$error:=cURL_FTP_Delete (JSON Stringify($options))
</code 4D>

Example is the basic one, without complications. In version 2.18 it works fine.
I have not tested with another server. If you want I can try it.

[Comunicats]NomDocument

is not very helpful.

can you please replace it with static text so that I know what characters to test?

also, please consider sharing the full list of parameters (you can obscure sensitive values) you pass as options.

Thank you,

I’m going to try it with another server and I’ll tell you something.

But in the field there are no incompatible characters ($, &, accents) Everything is minuscule without spaces. There is a filter.

And the username and password are correct. If I use the SEND function it sends them without problems.

I have done more tests. He sends me the data but does not delete it. Here the code:

Version 3.8

<code 4D>
C_OBJECT($options)
C_TEXT($URL)

$URL:=“ftp://ftp.192.168.100.19/webesquerra/abc.html
OB SET($options;“URL”;$URL;“USERNAME”;“arecursos”;“PASSWORD”;“abc467”)
$error:=cURL_FTP_Delete (JSON Stringify($options))/code4dus]

[code4dus]
C_OBJECT($options)
C_TEXT($URL)

$URL:=“ftp://192.168.100.19/webesquerra/abc.html
OB SET($options;“URL”;$URL;“USERNAME”;“arecursos”;“PASSWORD”;“abc467”)
$error:=cURL_FTP_Delete (JSON Stringify($options))
</code 4D>

I will try another FTP server. Thank you.

:idea:

: Joan GRABULEDA I SITJA

<code 4D>
$URL:=“ftp://ftp.192.168.100.19/webesquerra/abc.html
</code 4D>

Is this typo or the actually code (second “ftp” in URL)?

There are two options that I have tried to verify if the problem was here. In none has worked. Now I will try another FTP server and comment something.

please try the version (3.9) https://github.com/miyako/4d-plugin-curl-ftp/releases

as discussed in “issues”, FTP was fixed by SFTP is now broken.

Thank you.

It works perfectly.

:mrgreen:

Hello Miyako Keisuke,
Can you please help me.
I have tried a FTPS file transfer, but it do not work.
I have maybe done a small (or big) error.

Is it possible to have a look what I have done wrong?

//vt_userName:=“Username”
//vt_password:=“Password”
//$path:=System folder(Documents folder)+$FILENAME (pdf-file)
$vt_remote:=“ftps://koda-ftp.topcow.se/”
C_OBJECT($options)
If (Test path name($path)=Is a document)
vr_DocSize:=Get document size($path)

Progress QUIT (0)
$progressId:=Progress New 
Progress SET PROGRESS ($progressId;-1)
Progress SET BUTTON ENABLED ($progressId;False)
Progress SET TITLE ($progressId;navnFile)
OB SET($options;\
"URL";$vt_remote;\
"UPLOAD";1;\
"USERNAME";vt_userName;\
"PASSWORD";vt_password)

$vr_filesize:=(vr_DocSize/1000)/1000
Case of 
	: ($vr_filesize>10)
		OB SET($options;"UPLOAD_BUFFERSIZE";2000000)
	: ($vr_filesize>5)
		OB SET($options;"UPLOAD_BUFFERSIZE";1000000)
	Else 
		OB SET($options;"UPLOAD_BUFFERSIZE";500000)
End case 

$cacert:=Get 4D folder(Current resources folder)+"cacert.pem"
OB SET($options;"CAINFO";$cacert)  //need this for ftps
OB SET($options;"SSL_VERIFYPEER";0)
OB SET($options;"SSL_VERIFYHOST";0)
OB SET($options;"USE_SSL";"USESSL_TRY")

SET BLOB SIZE($Request;0)
SET BLOB SIZE($response;0)
If (Test path name($cacert)=Is a document)
	DOCUMENT TO BLOB($path;$Request)
	$error:=cURL (JSON Stringify($options);$Request;$response;"";$transferInfo;$headerInfo)
	If (BLOB size($response)>0)
		$returntxt:=Convert to text($response;"utf-8")
	End if 
Else 
	ALERT("Cacert file not found")
End if 
Progress QUIT ($progressId)

Else
ALERT(“No document found”)
End if

so want to upload, not download, right?

your URL should point to the file path, not just the host ($vt_remote)

Thanks.
Yes upload.
I have tried to upload the file with FileZilla and that works (password and username ok). Port 21.

It should be placed in the root directory.

Are there signs missing?
Or should the whole file-name be there?

OS : Mac OS X
Product :4D - 4D Server
OS : Mac OS X

I don’t recall off the top of my head, but it seems reasonable to supply the full path in URL.

: Keisuke MIYAKO

I don’t recall off the top of my head, but it seems reasonable to
supply the full path in URL.

For SFTP full path is mandatory, I don’t know if it is the same for FTPS, worth trying.

It is a pdf-file I want to upload. (I call it “doumentname.pdf” here):
I have tried with:
$vt_remote:=“ftp://koda-ftp.topcow.se/documentname.pdf
It get in contact with the server, but I only get a 35 error out of this.
(username and password should be ok, but maybe certification file is unknown?)

libcurl error 35 is about certificate. Could you login using the same certificate using third-party FTP client?

If you can, check the format of certificate, libcurl is not working with new certificate formats.

Hi Miyako,

I tried your plugin 4d-plugin-curl-ftp but it seems it only works with 4D 18.
I work with 4D v16 and i’d like to connect to a secure FTP (TLS)
Is there a version of your plugin that works with 4D v16 ? Or should i try your other plugin Curl ?

Regards.