ftp problem

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

ftp problem

miran-4
hi list,

I have been struggling with this for weeks now and I can't get it solved:
with a lasso script I'm transferring files from a ftp server to my webserver, this goes well, the files are copied to my webserver.
but when I open such file in a webbrowser or in macosx preview I get an error (opening in photoshop is no problem), if I open the file in bbedit I get a text at the beginning of my file:

220-Welcome To Rumpus!
220 Service ready for new user
331 Password required
230 User logged in
257 "/" is current directory.
250 CWD command successful
500 Command not understood
227 Entering Passive Mode (192,168,0,153,11,185)
200 Type set to I (Image)
213 187401 bytes
150 Opening connection (187401 bytes)

I think this is the reason why the files won't show in a webpage. I have tried different ftp servers.
is there anything I can do to get a clean jpg that will open in a webpage ?

how do other experience the ftp tags in lasso ?
any help or tips are much appreciated !

config: rumpus ftp on macosX 10.3.8, lasso 8.04 on macosX 10.3.8

thnx,
miran


--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: ftp problem

cJJUNnH41s90Y
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: ftp problem

miran-4
In reply to this post by miran-4
thanks for your reply, I'm using the standard libcurl 7.10.2 version.
how did you solve the ftp_getfile issue ?

miran

On dinsdag, 31 mei 2005 18:33, noah williamsson <[hidden email]> wrote:

>On the same config, with custom version of curl (and libcurl, which
>Lasso uses), i encountered the same problem with FTP_GetFile.
>
>The reason i updated curl was to get the "create missing dirs" option
>working in FTP_PutFile but unfortunately FTP_GetFile stopped working
>after that.
>
>Are you perhaps using a nonstandard libcurl version (installed by Fink
>for example)?
>If you run 'curl-config --version' in a terminal window it should say
>'libcurl 7.10.2' which is the default version on Mac OS X.3.
>
>   -- noah
>
>--
>------------------------------
>Lasso Support: http://support.omnipilot.com/
>Search the list archives: http://www.listsearch.com/lassotalk.lasso
>Manage your list subscription:  
>http://www.listsearch.com/lassotalk.lasso?manage
>


--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: ftp problem

Charles M Neville
In reply to this post by miran-4
I had a similar problem (LP 8.0.4 on 10.3.9) and have reported this to OP as
a bug, they say they're working on it - the problem is that FTP_Getfile adds
the server's status messages to the file.

Charlie


> I have been struggling with this for weeks now and I can't get it solved:
> with a lasso script I'm transferring files from a ftp server to my webserver,
> this goes well, the files are copied to my webserver.
> but when I open such file in a webbrowser or in macosx preview I get an error
> (opening in photoshop is no problem), if I open the file in bbedit I get a
> text at the beginning of my file:
>
> 220-Welcome To Rumpus!
> 220 Service ready for new user
> 331 Password required
> 230 User logged in
> 257 "/" is current directory.
> 250 CWD command successful
> 500 Command not understood
> 227 Entering Passive Mode (192,168,0,153,11,185)
> 200 Type set to I (Image)
> 213 187401 bytes
> 150 Opening connection (187401 bytes)
>
> I think this is the reason why the files won't show in a webpage. I have tried
> different ftp servers.
> is there anything I can do to get a clean jpg that will open in a webpage ?
>
> how do other experience the ftp tags in lasso ?
> any help or tips are much appreciated !
>
> config: rumpus ftp on macosX 10.3.8, lasso 8.04 on macosX 10.3.8
>
> thnx,
> miran



--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: ftp problem

miran-4
In reply to this post by miran-4
ok, I will just have to wait then untill it's fixed :-(

would there be any other options to get files from server A to my webserver with lasso ?

miran



On woensdag, 1 juni 2005 09:31, Charles M Neville <[hidden email]> wrote:

>I had a similar problem (LP 8.0.4 on 10.3.9) and have reported this to OP as
>a bug, they say they're working on it - the problem is that FTP_Getfile adds
>the server's status messages to the file.
>
>Charlie
>
>
>> I have been struggling with this for weeks now and I can't get it solved:
>> with a lasso script I'm transferring files from a ftp server to my webserver,
>> this goes well, the files are copied to my webserver.
>> but when I open such file in a webbrowser or in macosx preview I get an error
>> (opening in photoshop is no problem), if I open the file in bbedit I get a
>> text at the beginning of my file:
>>
>> 220-Welcome To Rumpus!
>> 220 Service ready for new user
>> 331 Password required
>> 230 User logged in
>> 257 "/" is current directory.
>> 250 CWD command successful
>> 500 Command not understood
>> 227 Entering Passive Mode (192,168,0,153,11,185)
>> 200 Type set to I (Image)
>> 213 187401 bytes
>> 150 Opening connection (187401 bytes)
>>
>> I think this is the reason why the files won't show in a webpage. I have tried
>> different ftp servers.
>> is there anything I can do to get a clean jpg that will open in a webpage ?
>>
>> how do other experience the ftp tags in lasso ?
>> any help or tips are much appreciated !
>>
>> config: rumpus ftp on macosX 10.3.8, lasso 8.04 on macosX 10.3.8
>>
>> thnx,
>> miran
>
>
>
>--
>------------------------------
>Lasso Support: http://support.omnipilot.com/
>Search the list archives: http://www.listsearch.com/lassotalk.lasso
>Manage your list subscription:  
>http://www.listsearch.com/lassotalk.lasso?manage
>


--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: ftp problem

cJJUNnH41s90Y
In reply to this post by miran-4
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: ftp problem

cJJUNnH41s90Y
In reply to this post by miran-4
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: ftp problem

miran-4
In reply to this post by miran-4
unfortunately that is not an option, the files are on a fileserver in a lan.

miran

On woensdag, 1 juni 2005 10:57, noah williamsson <[hidden email]> wrote:

>[hidden email] wrote:
>> ok, I will just have to wait then untill it's fixed :-(
>>
>> would there be any other options to get files from server A to my
>> webserver with lasso ?
>
>[Include_URL] if the files are available over HTTP.
>
>   -- noah
>
>--
>------------------------------
>Lasso Support: http://support.omnipilot.com/
>Search the list archives: http://www.listsearch.com/lassotalk.lasso
>Manage your list subscription:  
>http://www.listsearch.com/lassotalk.lasso?manage
>


--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: ftp problem

Adam Randall
In reply to this post by miran-4
Here is a work around for the FTP_GetFile issue:

Use the HTTP_GetFile command instead of FTP_GetFile. HTTP_GetFile  
uses Include_URL to get the files, which is basically just our  
interface to CURL. CURL supports connecting to things other than just  
the HTTP protocol, so you could do something like this:

[HTTP_GetFile: -URL = 'ftp://.../myfile.txt', -File = 'File.txt', -
Username = 'Username', -Password = 'Password']

Unfortunately, I just identified a bug in the HTTP_GetFile tag itself  
for both 7 and 8 where it puts the -username and -password parameters  
in the wrong spot when calling Include_URL internally. Anyway, the  
following is a new version of http_getfile that will work with both  
LP7 and LP8:

<?LassoScript

     //
     // [HTTP_GetFile]
     //
     // Overriding built in tag so that it works
     //

     define_tag: 'HTTP_GetFile2',
         -priority = 'replace',
         -required = 'URL',
         -optional = 'File',
         -optional = 'Username',
         -optional = 'Password',
         -optional = 'Binary';

         local:
             'ec' = error_code,
             'em' = error_msg;

         local:
             '_un' = (string: (local: 'username')),
             '_pw' = (string: (local: 'password')),
             '_curlparams' = array,
             '_data' = null;

         if: #em == 'No error';
             #em = '';
         /if;

         error_code = 0;
         error_msg = '';

         fail_if:
             (!(local_defined: 'binary')) && (!(local_defined: 'file')),
             -9951,
             'HTTP_GetFile2: -File parameter is required when not  
using -Binary parameter';

         protect;

             #_curlparams->(insert: #URL);

             if: #_un->size;
                 #_curlparams->(insert: -Username = @#_un);
                 if: !#_pw->size;
                     #_curlparams->(insert: -Password = @#_pw);
                 /if;
             /if;

             if: #_pw->size;
                 #_curlparams->(insert: -Password = @#_pw);
                 if: !#_un->size;
                     #_curlparams->(insert: -Username = @#_un, 1);
                 /if;
             /if;

             #_data = \include_url->(run: -params = #_curlparams);

             fail_if:
                 error_code != 0,
                 error_code,
                 'HTTP_GetFile2: ' error_msg;

             if: !(local_defined: 'Binary');

                 file_create: #File, -fileoverwrite;

                 fail_if:
                     file_currenterror != 'No error',
                     (file_currenterror: -errorcode),
                     'HTTP_GetFile2: ' file_currenterror;

                 file_write: #File, #_data;

                 fail_if:
                     file_currenterror != 'No error',
                     (file_currenterror: -errorcode),
                     'HTTP_GetFile2: ' file_currenterror;

             /if;

             handle_error;
                 #ec = error_code;
                 #em = 'HTTP_GetFile2: ' error_msg;
             /handle_error;

         /protect;

         error_code = #ec;
         error_msg = #em;

         if: (local_defined: 'Binary') && (#_data->type == 'bytes');
             return: #_data;
         else;
             return: null;
         /if;

     /define_tag;

?>

Regards,

Adam.

--
Adam Randall <[hidden email]>
http://www.omnipilot.com/
(954) 874-3100
AIM/iChat: adamomni

On Jun 1, 2005, at 5:13 AM, miran wrote:

> unfortunately that is not an option, the files are on a fileserver  
> in a lan.
>
> miran
>
> On woensdag, 1 juni 2005 10:57, noah williamsson <[hidden email]> wrote:
>
>> [hidden email] wrote:
>>
>>> ok, I will just have to wait then untill it's fixed :-(
>>>
>>> would there be any other options to get files from server A to my
>>> webserver with lasso ?
>>>
>>
>> [Include_URL] if the files are available over HTTP.
>>
>>   -- noah
>>
>> --
>> ------------------------------
>> Lasso Support: http://support.omnipilot.com/
>> Search the list archives: http://www.listsearch.com/lassotalk.lasso
>> Manage your list subscription:
>> http://www.listsearch.com/lassotalk.lasso?manage
>>
>>
>
>
> --
> ------------------------------
> Lasso Support: http://support.omnipilot.com/
> Search the list archives: http://www.listsearch.com/lassotalk.lasso
> Manage your list subscription:
> http://www.listsearch.com/lassotalk.lasso?manage
>


--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: ftp problem

miran-4
In reply to this post by miran-4
Great ! this works like a charm, thank you very much.

I still have one minor problem, after the files are transferred to the webserver (webstar 5.4.3), lasso creates directories for the files (they belong to different projects), the files are then owned by lasso and webstar can't use them. to show the files in a webpage the owner must be 'admin' or 'webstar'.
how do I let lasso create the right permissions for the directories/files ?

miran



On woensdag, 1 juni 2005 15:04, Adam Randall <[hidden email]> wrote:
>Here is a work around for the FTP_GetFile issue:
>

>
>Regards,
>
>Adam.
>
>--
>Adam Randall <[hidden email]>
>http://www.omnipilot.com/
>(954) 874-3100
>AIM/iChat: adamomni
>



--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: ftp problem

Adam Randall
In reply to this post by miran-4
[file_chmod] to change it to rxrxrx. they will still be owned by  
lasso, but they will be readable by webstar.

Adam.

--
Adam Randall <[hidden email]>
http://www.omnipilot.com/
(954) 874-3100
AIM/iChat: adamomni

On Jun 1, 2005, at 10:03 AM, miran wrote:

> Great ! this works like a charm, thank you very much.
>
> I still have one minor problem, after the files are transferred to  
> the webserver (webstar 5.4.3), lasso creates directories for the  
> files (they belong to different projects), the files are then owned  
> by lasso and webstar can't use them. to show the files in a webpage  
> the owner must be 'admin' or 'webstar'.
> how do I let lasso create the right permissions for the directories/
> files ?
>
> miran
>
>
>
> On woensdag, 1 juni 2005 15:04, Adam Randall  
> <[hidden email]> wrote:
>
>> Here is a work around for the FTP_GetFile issue:
>>
>>
>
>
>>
>> Regards,
>>
>> Adam.
>>
>> --
>> Adam Randall <[hidden email]>
>> http://www.omnipilot.com/
>> (954) 874-3100
>> AIM/iChat: adamomni
>>
>>
>
>
>
> --
> ------------------------------
> Lasso Support: http://support.omnipilot.com/
> Search the list archives: http://www.listsearch.com/lassotalk.lasso
> Manage your list subscription:
> http://www.listsearch.com/lassotalk.lasso?manage
>


--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage