Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Thu Dec 12, 2019 1:53 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: MBS-CURLSMBS
PostPosted: Mon Aug 01, 2011 10:41 am 
Offline
User avatar

Joined: Mon Nov 29, 2010 7:01 pm
Posts: 446
I can't for the life of me get the CURLSMBS to upload the body of my file. If I use the example UploadCURL it works and attaches the body of the binary stream. But for whatever reason I use the same code for the CURLSMBS and it doesn't work. The only line different is the "d.stream=b" line doesn't exist. But the methods for the UploadCURL don't show it having any functionality other than displaying the progress of the upload.

How can I get the body of my file to be attached to the CURLSMBS?

dim f as folderitem = Getfolderitem(ListBox2.text + ".txt") //will be in same folder as the executable.
dim e as integer
dim d as CURLSMBS
//dim d as new UPLOADCURL
dim b as BinaryStream
Dim fileStream as TextOutputStream


if f=nil then
MsgBox "F is nil"
end
fileStream=TextOutputStream.Create(f)
fileStream.WriteLine(TextArea1.text)
fileStream.Close


//METHOD WITH CURLSMBS
//

b=f.OpenAsBinaryFile(false)
d=new CURLSMBS
d.OptionURL="sftp://BLAHBLAHBLAH"
d.YieldTime = true
d.OptionUpload=true
d.OptionFTPCreateMissingDirs=2
d.OptionInFileSize=b.Length
d.OptionFTPSSL = d.kFTPSSL_CONTROL
d.OptionSSLVerifyPeer=0
d.OptionSSLVerifyHost=0




//But if I use the below code it works.

'b=f.OpenAsBinaryFile(false)
'd=new UploadCURL
'd.stream=b
'd.OptionURL="sftp://BLAHBLAHBLAH"
'd.YieldTime = true
'd.OptionUpload=true
'd.OptionFTPCreateMissingDirs=2
'd.OptionInFileSize=b.Length
'd.OptionFTPSSL = d.kFTPSSL_CONTROL
'd.OptionSSLVerifyPeer=0
'd.OptionSSLVerifyHost=0
'e=d.Perform


Top
 Profile  
Reply with quote  
 Post subject: Re: MBS-CURLSMBS
PostPosted: Mon Aug 01, 2011 11:04 am 
Offline
User avatar

Joined: Wed May 10, 2006 2:42 pm
Posts: 2985
Location: Germany
Hello,

you must subclass CURLSMBS/CURLMBS class. If you don't do that, you will have no read or write events and the upload/download will always fail because data can't be read or written.

Our UploadCURL class in the examples can take data in one version from binarystream and in other version from string.

In any case, please check error codes. Also please use OptionVerbose = true and the DebugMessage event to learn about what went wrong.

Greetings
Christian

_________________
See you in Orlando, Florida for Real World 2013
More details and registration here:
http://www.realsoftware.com/community/realworld.php


Top
 Profile  
Reply with quote  
 Post subject: Re: MBS-CURLSMBS
PostPosted: Mon Aug 01, 2011 2:20 pm 
Offline
User avatar

Joined: Mon Nov 29, 2010 7:01 pm
Posts: 446
Thank you, it's all working great now. I can download and upload files as needed. I didn't find an example of deleting a file using SFTP however. Is this possible?


Top
 Profile  
Reply with quote  
 Post subject: Re: MBS-CURLSMBS
PostPosted: Mon Aug 01, 2011 2:29 pm 
Offline
User avatar

Joined: Wed May 10, 2006 2:42 pm
Posts: 2985
Location: Germany
I think you can give commands with SetOptionPostQuote method. Like a rm command.

Greetings
Christian

_________________
See you in Orlando, Florida for Real World 2013
More details and registration here:
http://www.realsoftware.com/community/realworld.php


Top
 Profile  
Reply with quote  
 Post subject: Re: MBS-CURLSMBS
PostPosted: Mon Aug 01, 2011 4:02 pm 
Offline
User avatar

Joined: Mon Nov 29, 2010 7:01 pm
Posts: 446
MonkeybreadSoftware wrote:
I think you can give commands with SetOptionPostQuote method. Like a rm command.

Greetings
Christian


Where would I find documentation and help on this, the documentation on the MBS Site doesn't cover much of anything other than list the coding in the example files. The documentation doesn't seem to cover the plugin objects themselves.


Top
 Profile  
Reply with quote  
 Post subject: Re: MBS-CURLSMBS
PostPosted: Mon Aug 01, 2011 4:19 pm 
Offline
User avatar

Joined: Wed May 10, 2006 2:42 pm
Posts: 2985
Location: Germany
Did you look here?

http://www.monkeybreadsoftware.net/class-curlsmbs.shtml

Greetings
Christian

_________________
See you in Orlando, Florida for Real World 2013
More details and registration here:
http://www.realsoftware.com/community/realworld.php


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group