libURLftpUploadFile insanity

Sivakatirswami katir at hindu.org
Sun Jun 25 05:51:20 EDT 2006


Yes, I have a number of empty patches on my scalp where whole  
sections of hair were pulled out on this matter. (smile)

First simplest line of investigation: You may not want to be  
declaring the protocol in the domain name.  if you have that kind of  
user name (I have them on one of our servers) it means you may be  
running on a virtual host on a shared IP... (another story) and the  
DNS-FTP servers may not be happy with "ftp.myDomain.com" --- just use  
the same string you do for browsing.

Start simple: test this in the msg box:

put hostNametoAddress("ftp.mydomain.com")

If you get an IP, then that means  that is *not* the problem..and get  
back to us...

  if you don't get an IP then that *is* the problem. Unless you have  
direct control over your DNS, not all DNS set ups on virtual hosts  
will necessarily make an A name or CName entry in the matrix for   
"ftp.mydomain.com"  for security reasons,  so proceed as follows

try this test  in the  msgbox (multi line)

[note that parenthesis may help... as  URL expressions don't always  
evaluate as expected]

put "me at mydomain.com" into userName
put url  ("ftp://"  URLEncode(userName) &\  
":myExplicitPwd at www.myDomain.com/httpdocs[or"html"]/someFooDirectory/")

and you should get a file listing.  www.myDomain.com will simply  
resolve to the  IP for your domain, which is what  you want. if that  
works, then you are good to go... if not, take a deep breath: take   
the next steps:

On some servers you have to call an explicit path from the virtual  
server root for it to work at all... *not* from DOCROOT as defined in  
the  httpd.conf file... That's because Apache is not handling this  
thing but the FTP server on the box is.

e.g. easiest way to find out: if you use an FTP client and  simply  
log into the domain without any path and it drops  you into the  
virtual private serve root you will see something like

etc
var
private
bin

etc...

and you need to explore such arcane strings as:

ftp://fooUser:fooPsword@www.Mydomain.com//var/www/html/somefooDirectory

Yes, you may need double slash in there for this to work correctly  
and use the  full explicit string from there  down to the httpdocs  
(or /html/  depending on the OS config...), almost always in /var/ 
www/ directory .... tech support can fiddle with the FTP server  
config (not something you want to play with unless you really know  
what you are doing) to make sure  you always get dropped into the var/ 
www/html directory, but that's not standard, because many "macho"  
users will want FTP access to the other lo-level none HTML   
directories if they are savvy enough to use them with out breaking  
anything.

In your FTP client you start digging into /var then /www then /html/  
and when you get to see your web directories, look at the explicit  
FTP URL currently displayed in you FTP client and emulate that in Rev.

I've been down this road several times....

Good luck.

Sivakatirswami


On Jun 24, 2006, at 5:07 PM, stevex64 wrote:

> on mouseUp
>   answer file "Select a file to upload"
>   put "me at mydomain.com" into userName
>   put "myPW" into userPassword
>   put "ftp.mydomain.com" into myServer
>
>   put "ftp://" & URLEncode(userName) & ":" & userPassword & "@" &  
> myServer
> into myFTPURL
>   libURLftpUploadFile it, myFTPURL
>   put libUrlErrorData(myFTPURL)
> end mouseUp




More information about the use-livecode mailing list