Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Thu Apr 27, 2017 9:21 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: Need help with Monkeybread Curl Plugin for FTP Upload
PostPosted: Sat Oct 20, 2012 6:41 am 
Offline
User avatar

Joined: Sat May 28, 2011 11:28 pm
Posts: 130
Location: Beijing China
Hi, I just bought Monkey bread Curl Plugin, and I got totally stuck

I'm developing a program that manage a website.
I need a very simple way for me to upload images and music to my ftp server.

I've been trying and looking at the examples, but both aren't working.
the only thing that was working is a directory view of my server.

when Uploading, with e=d.Perform, then e is returning code 23 in my program and in the example code 67

my code look like this

//upload Image to server
dim f as FolderItem
f = new FolderItem (filename.Text + ".jpg")
NewDjImage.Save (f, picture.SaveAsJPEG, picture.QualityMedium)

dim d as new UploadCURL
dim e as Integer
dim b as BinaryStream
b = f.openasbinaryfile(false)
d.OptionUsername = "username"
d.OptionPassword = "password"
d.stream = b
d.OptionURL = "ftp.myserver.com"
d.OptionUpload = true
d.OptionInFileSize = b.Length
e=d.Perform

msgbox cstr(e)


can anyone help me out

Thanks

_________________
For great Music got to my podcast Website!!!
http://podcast.1945mf-china.com


Top
 Profile  
 
 Post subject: Re: Need help with Monkeybread Curl Plugin for FTP Upload
PostPosted: Sat Oct 20, 2012 8:41 am 
Offline
User avatar

Joined: Wed May 10, 2006 2:42 pm
Posts: 2985
Location: Germany
Error 23 is a write error.

Do you have code in Write event in UploadCURL class?
Or maybe it's some permissions on the ftp server.

You should use OptionVerbose to enable debug messages.
And write down into a log file what you get in the DebugMessage event.

This way you may easily find what's 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  
 
 Post subject: Re: Need help with Monkeybread Curl Plugin for FTP Upload
PostPosted: Sat Oct 20, 2012 9:07 am 
Offline
User avatar

Joined: Sat May 28, 2011 11:28 pm
Posts: 130
Location: Beijing China
hi,

No I don't have code in the write error event.
I copied most code from the examples.

I did what you said, and I get Closing Connection #0

_________________
For great Music got to my podcast Website!!!
http://podcast.1945mf-china.com


Top
 Profile  
 
 Post subject: Re: Need help with Monkeybread Curl Plugin for FTP Upload
PostPosted: Sat Oct 20, 2012 9:16 am 
Offline
User avatar

Joined: Wed May 10, 2006 2:42 pm
Posts: 2985
Location: Germany
So please put some code in Write event.

something like

msgbox data
return lenb(data)

The return is required as you need to tell what amount of data you accepted.

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  
 
 Post subject: Re: Need help with Monkeybread Curl Plugin for FTP Upload
PostPosted: Sat Oct 20, 2012 9:23 am 
Offline
User avatar

Joined: Sat May 28, 2011 11:28 pm
Posts: 130
Location: Beijing China
I think I found the problem. I tried to copy a new file to the server, this didn't give any problems. but I need to Replace files (Overwrite)

_________________
For great Music got to my podcast Website!!!
http://podcast.1945mf-china.com


Top
 Profile  
 
 Post subject: Re: Need help with Monkeybread Curl Plugin for FTP Upload
PostPosted: Sat Oct 20, 2012 9:41 am 
Offline
User avatar

Joined: Wed May 10, 2006 2:42 pm
Posts: 2985
Location: Germany
Well, some servers are configured to forbid overwriting.

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  
 
 Post subject: Re: Need help with Monkeybread Curl Plugin for FTP Upload
PostPosted: Sat Oct 20, 2012 9:55 am 
Offline
User avatar

Joined: Sat May 28, 2011 11:28 pm
Posts: 130
Location: Beijing China
If I upload with Dreamweaver, then it overwrites the files without any problem.
Is there a setting for enabling overwriting, or do I need to delete the file 1st and then transfer it?

_________________
For great Music got to my podcast Website!!!
http://podcast.1945mf-china.com


Top
 Profile  
 
 Post subject: Re: Need help with Monkeybread Curl Plugin for FTP Upload
PostPosted: Sat Oct 20, 2012 12:44 pm 
Offline
User avatar

Joined: Wed May 10, 2006 2:42 pm
Posts: 2985
Location: Germany
Overwrite should simply work without an extra settings.

Maybe you send me your test project by email and I check it for you?

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  
 
 Post subject: Re: Need help with Monkeybread Curl Plugin for FTP Upload
PostPosted: Sat Oct 20, 2012 6:04 pm 
Offline
User avatar

Joined: Sat May 28, 2011 11:28 pm
Posts: 130
Location: Beijing China
I just found out, that it is working somehow.
If i Overwrite the image, then it looks like it didn't upload, my program is still downloading the old one.
but if I wait, I don't know how long, but I waited a few ours, then the Image is the one I uploaded.

the return code now is 0, so I think this is correct, right?

_________________
For great Music got to my podcast Website!!!
http://podcast.1945mf-china.com


Top
 Profile  
 
 Post subject: Re: Need help with Monkeybread Curl Plugin for FTP Upload
PostPosted: Sun Oct 21, 2012 3:06 am 
Offline
User avatar

Joined: Wed May 10, 2006 2:42 pm
Posts: 2985
Location: Germany
Yes. Maybe your browser caches it.

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  
 
 Post subject: Re: Need help with Monkeybread Curl Plugin for FTP Upload
PostPosted: Wed Mar 20, 2013 9:17 pm 
Offline

Joined: Thu May 13, 2010 7:27 pm
Posts: 341
Does anyone have an idea on how you can use the MBS Curl plug-in to FTP files to a server but only ones that have been modified since the existing ones?

Thanks


Top
 Profile  
 
 Post subject: Re: Need help with Monkeybread Curl Plugin for FTP Upload
PostPosted: Wed Mar 20, 2013 9:36 pm 
Offline
User avatar

Joined: Sat May 28, 2011 11:28 pm
Posts: 130
Location: Beijing China
willgonz wrote:
Does anyone have an idea on how you can use the MBS Curl plug-in to FTP files to a server but only ones that have been modified since the existing ones?

Thanks


not sure what you mean, but If you want to upload only modified files, then you should check the date of the file on the server
if you file is newer then upload it

I haven't worked with Curl for a while, but When I used it for the first time, it didn't took me long to understand it.
just look at the examples and copy there code to your project and start working from there

remember, if you upload images for a website, then it's better to add a seed file, can be a plain txt file with a number
then in your website, use PHP to load that number in a variable and add the after every image like test.jpg?seed='$seed_number' or something like that

this way you will reload all the images of your website

_________________
For great Music got to my podcast Website!!!
http://podcast.1945mf-china.com


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

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 2 guests


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