Ftp woes

Tim tim11 at bellatlantic.net
Tue Apr 23 00:55:01 EDT 2002


On 4/22/02 4:50 PM, "Dave Cragg" <dcragg at lacscentre.co.uk> wrote:

> At 4:10 pm -0400 22/4/02, Tim wrote:
>> Hi, I¹m having difficulties compressing and uploading a stack to my
>> FTP server. Here¹s the code:
>> 
>> 
>> on mouseUp
>>   save stack "TestStack"
>>   put "PowerBookHD/Revolution Projects/TestStack.rev" into \
>> tLocalFile --TestStack is a Revolution Stack containing 3 other substacks
>>   put compress(tLocalFile) into URL
>> "ftp://myusername@domain.com:mypassword@ftp.business.earthlink.net/www/TestSt
>> ack"
>>   close stack "TestStack"
>> end mouseUp
>> 
> 
> Two problems:
> 
> 1.  with the file data (need to use "url" syntax)
> 2.  with the user name (need to urlEncode because of the "@" character)
> 
> 
> put "/PowerBookHD/Revolution Projects/TestStack.rev" into tLocalFile
> put "myusername at domain.com" into tName
> put "ftp://" & urlEncode(tName) & ":mypassword" & "@" into tUrl
> put "ftp.business.earthlink.net/www/TestStack" after tUrl
> put url ("binfile:" & tLocalFile) into tData
> put compress(tData) into url tUrl
> if the result is not empty then
>  answer the result ##error check
> end if
> 
> If the password contains any "funny" characters, you should urlEncode
> that too. (but not the ":" separating the name and password)
> 
> Cheers
> Dave Cragg


That did it. Thanks a bunch! Is there a way to reverse engineer this so that
a shell stack could open this TestStack from the ftp server?

Thanks again,
-- 
Tim




More information about the use-livecode mailing list