Xojo Conferences
XDCMay2019MiamiUSA

[MBS] FTP directory listing using CURL library (MBS Xojo Plugin Mailinglist archive)

Back to the thread list
Previous thread: [MBS] QTGrabber: no camera found in Windows
Next thread: [MBS] QTGrabberMBS select between two identically-named video devices?


RE: [MBS] DOM classes for Mac OS X HTMLViewer   -   Giovanni
  [MBS] FTP directory listing using CURL library   -   Florian
   Re: [MBS] FTP directory listing using CURL library   -   Christian Schmitz
    Re: [MBS] FTP directory listing using CURL library   -   Florian
   Re: [MBS] FTP directory listing using CURL library   -   Christian Schmitz
    Re: [MBS] FTP directory listing using CURL library   -   Florian
     Re: [MBS] FTP directory listing using CURL library   -   Christian Schmitz

[MBS] FTP directory listing using CURL library
Date: 11.04.08 09:29 (Fri, 11 Apr 2008 01:29:45 -0700)
From: Florian
Hi,

I tried out the CURL library from within the MBS plugin today, but wasn't able to figure out how to work with it. ;-)

I played a bit around with the examples for up- and downloading data, they work just fine. However, I was not able to write some working code for a simple directory listing of some path of my ftp server.

I tried with the following code:

Dim f As FolderItem
Dim e As Integer
Dim d As FTPKlasse
Dim b As BinaryStream
Dim s As String

d = new FTPKlasse //FTPKlasse is an instance of the CURLMBS class
s = "ftp://"+fldUser.text+":"+fldPwd.text+"@"+fldUrl.text //Three text fields including password, username and the server url
d.OptionURL = s
e = d.Perform

MsgBox str(e)

The result the msgBox at the end shows me is 23 - Some write error, according to the MBS documentation. What am I missing, is this the completely wrong way for getting a directory listing back? I wasn't able to find any documentation/examples for doing so. So, I would really appreciate any help! :-)

Florian
_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
<email address removed>
http://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Re: [MBS] FTP directory listing using CURL library
Date: 11.04.08 11:16 (Fri, 11 Apr 2008 12:16:46 +0200)
From: Christian Schmitz
Florian <<email address removed>> wrote:

> Hi,
>
> d = new FTPKlasse //FTPKlasse is an instance of the CURLMBS class
> s = "ftp://"+fldUser.text+":"+fldPwd.text+"@"+fldUrl.text //Three text
> fields including password, username and the server url
> d.OptionURL = s

d.OptionFTPListOnly=True

you should check the options for whether you have to set a few of them.

Gruß
Christian

-

Re: [MBS] FTP directory listing using CURL library
Date: 11.04.08 12:56 (Fri, 11 Apr 2008 04:56:14 -0700)
From: Florian
I added the option you suggested and also looked through the other options, but there did not come anything to my mind I could need. ;-)

Still, when executing the code, I get the write error 23 as an answer. Is this the right way of getting a directory listing of an ftp directory or am I missing something. Are there any examples available for that. I couldn't find something like what I am searching on the web, so I think it just quite simple, maybe too simple for me. ;-)

Florian

"Christian Schmitz" <<email address removed>> wrote:
>Florian <<email address removed>> wrote:
>
>> Hi,
>>
>> d = new FTPKlasse //FTPKlasse is an instance of the CURLMBS class
>> s = "ftp://"+fldUser.text+":"+fldPwd.text+"@"+fldUrl.text //Three text
>> fields including password, username and the server url
>> d.OptionURL = s
>
>d.OptionFTPListOnly=True
>
>you should check the options for whether you have to set a few of them.
>
>Gruß
>Christian
>
>--
>Over 1000 classes with 20000 functions in one REALbasic plug-in.
>The Monkeybread Software Realbasic Plugin v8.2.
>
><http://www.monkeybreadsoftware.de/realbasic/plugins.shtml>
>_______________________________________________
>Mbsplugins_monkeybreadsoftware.info mailing list
><email address removed>
>http://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info
>
_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
<email address removed>
http://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Re: [MBS] FTP directory listing using CURL library
Date: 11.04.08 13:06 (Fri, 11 Apr 2008 14:06:50 +0200)
From: Christian Schmitz
Hi,

here I got it work with this:

dim s as string
dim e as integer
dim d as DownloadCURL

d=new DownloadCURL
d.OptionURL=url.text
d.optionfTPListOnly=true
d.optionuserPassword="user:password"
e=d.Perform

editfield1.text=d.datas

select case e
case 9
s=" CURLE_FTP_ACCESS_DENIED"
case 67
s=" CURLE_LOGIN_DENIED"
end select

ResultText.text="Result: "+str(e)+s

Of course user and password must be correct and the url is
"ftp://monkeybreadsoftware.de/" for me.

Gruß
Christian

-

Re: [MBS] FTP directory listing using CURL library
Date: 11.04.08 13:51 (Fri, 11 Apr 2008 05:51:25 -0700)
From: Florian
Thanks Christian,

I made it work. I forget some code for the write event in the CURLMBS class. That was the mistake. I simply used the code from the "CURL picture download.rb" example from within the CURL folder in the examples folder of your plugin. Now everything works just fine.

BTW, OT: Do you know why I can't reply/send any messages to the list from within the Mail app of OS X 10.5.2? I always get an auto-reply from the list telling me the MIME type would be wrong.
Using .mac webmail works fine. I also made sure that Mail sends the email as raw text, not formatet, not HTML. (At least I told it to do.) But this did not change anything.

Am 11/04/08 um 14:06 schrieb "Christian Schmitz" <<email address removed>>:
>Hi,
>
>here I got it work with this:
>
> dim s as string
> dim e as integer
> dim d as DownloadCURL
>
> d=new DownloadCURL
> d.OptionURL=url.text
> d.optionfTPListOnly=true
> d.optionuserPassword="user:password"
> e=d.Perform
>
> editfield1.text=d.datas
>
> select case e
> case 9
> s=" CURLE_FTP_ACCESS_DENIED"
> case 67
> s=" CURLE_LOGIN_DENIED"
> end select
>
> ResultText.text="Result: "+str(e)+s
>
>Of course user and password must be correct and the url is
>"ftp://monkeybreadsoftware.de/" for me.
>
>Gruß
>Christian
>
>--
>Over 1000 classes with 20000 functions in one REALbasic plug-in.
>The Monkeybread Software Realbasic Plugin v8.2.
>
><http://www.monkeybreadsoftware.de/realbasic/plugins.shtml>
>_______________________________________________
>Mbsplugins_monkeybreadsoftware.info mailing list
><email address removed>
>http://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info
>
_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
<email address removed>
http://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Re: [MBS] FTP directory listing using CURL library
Date: 11.04.08 14:09 (Fri, 11 Apr 2008 15:09:35 +0200)
From: Christian Schmitz
Florian <<email address removed>> wrote:

> Thanks Christian,
>
> I made it work. I forget some code for the write event in the CURLMBS
> class. That was the mistake. I simply used the code from the "CURL picture
> download.rb" example from within the CURL folder in the examples folder of
> your plugin. Now everything works just fine.

Ok.

> BTW, OT: Do you know why I can't reply/send any messages to the list from
> within the Mail app of OS X 10.5.2?

Well, I bet mail still sends our two mime parts. So don't care.

Gruß
Christian

-