Saving an image from FMSA FMContainer into folder and name it

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

Saving an image from FMSA FMContainer into folder and name it

detlef.hebbel
Hello. (second try)

I have a further question please:
As this script below works fine to show an image from a FMContainer on a
page, now I need to save an image, without showing it on a page, (ie.
working it in the background):

How can I tweak this Script below, to save the image into a folder and
giving it a name 'MyImage.jpg'?

>>> <?LassoScript
>>>      content_type: 'image/jpeg';
>>>      inline:
>>>          -database = 'db',
>>>          -table = 'tb',
>>>          -keyvalue = 1,
>>>          -novaluelists,
>>>          -search;
>>>          $__html_reply__ = (database_fmcontainer:
>>> 'ImageGeneric_PhotoSmall');
>>>      /inline;
>>>      abort;
>>> ?>


Earlier tests did not work.

Any help would be appreciated.

Cheers

Detlef



--
------------------------------
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: Saving an image from FMSA FMContainer into folder and name it

Douglas Burchard
On May 23, 2005, at 2:41 PM, Detlef Hebbel wrote:

> How can I tweak this Script below, to save the image into a folder and
> giving it a name 'MyImage.jpg'?

It would be something like:

     <?LassoScript

         Inline:
                 -Database = 'db',
                 -Table = 'tb',
                 -KeyValue = (1),
                 -NoValueLists,
                 -Search;
             Var: 'filedata' = (Database_FMContainer:  
'ImageGeneric_PhotoSmall');
             Var: 'image' = (Image: -Binary=$filedata);
             $image -> (Save: '/folder/MyImage.jpg', -Quality=(100));
         /Inline;

     ?>


--
Douglas Burchard, President
DouglasBurchard.com, Web Applications
15024 NE 66th Street
Redmond, WA  98052, USA

direct: (206) 227-8161
[hidden email]
http://www.douglasburchard.com/


--
------------------------------
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: Saving an image from FMSA FMContainer into folder and name it

detlef.hebbel
In reply to this post by detlef.hebbel
Thank you Douglas.

This looks promising, but I get an error:


Error Message: 
Error: Field not found or enabled.
at: FMContainer with params: 'ImageGeneric_PhotoSmall'
at: Admin/Vehicles/SaveImagesFromFMContainer.lasso on line: 25 at position:
30
at: inline with params: -Database='eMarketing_002', -Table='VehiclesImages',
-KeyValue=1, -NoValueLists, -MaxRecords=1, -Search
at: Admin/Vehicles/SaveImagesFromFMContainer.lasso
Error Code: 
-1


... is this line:

             Var: 'image' =(Database_FMContainer:'ImageGeneric_PhotoSmall');


All Lasso and file permissions are given and the field is on the table and
the spelling is right!



Any idea what to change?

Cheers

Detlef



on 24.05.2005 15:40, Douglas Burchard at
[hidden email] wrote:

> On May 23, 2005, at 2:41 PM, Detlef Hebbel wrote:
>
>> How can I tweak this Script below, to save the image into a folder and
>> giving it a name 'MyImage.jpg'?
>
> It would be something like:
>
>      <?LassoScript
>
>          Inline:
>                  -Database = 'db',
>                  -Table = 'tb',
>                  -KeyValue = (1),
>                  -NoValueLists,
>                  -Search;
>              Var: 'filedata' = (Database_FMContainer:
> 'ImageGeneric_PhotoSmall');
>              Var: 'image' = (Image: -Binary=$filedata);
>              $image -> (Save: '/folder/MyImage.jpg', -Quality=(100));
>          /Inline;
>
>      ?>
>
>
> --
> Douglas Burchard, President
> DouglasBurchard.com, Web Applications
> 15024 NE 66th Street
> Redmond, WA  98052, USA
>
> direct: (206) 227-8161
> [hidden email]
> http://www.douglasburchard.com/
>



--
------------------------------
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: Saving an image from FMSA FMContainer into folder and name it

Douglas Burchard
In reply to this post by detlef.hebbel
On May 23, 2005, at 9:56 PM, Detlef Hebbel wrote:

> This looks promising, but I get an error:
>
> Error Message:
> Error: Field not found or enabled.
> at: FMContainer with params: 'ImageGeneric_PhotoSmall'
> at: Admin/Vehicles/SaveImagesFromFMContainer.lasso on line: 25 at  
> position:
> 30
> at: inline with params: -Database='eMarketing_002', -
> Table='VehiclesImages',
> -KeyValue=1, -NoValueLists, -MaxRecords=1, -Search
> at: Admin/Vehicles/SaveImagesFromFMContainer.lasso
> Error Code:
> -1
>
> All Lasso and file permissions are given and the field is on the  
> table and
> the spelling is right!
>
> Any idea what to change?

Hmm, I wouldn't have expected a problem with that line since you had  
working code before for serving the same data. Try taking out all of  
the code after the offending line (except closing containers) to see  
if the error changes. This might help better define the problem:

     <?LassoScript

         Inline:
                 -Database = 'db',
                 -Table = 'tb',
                 -KeyValue = (1),
                 -NoValueLists,
                 -Search;
             Var: 'filedata' = (Database_FMContainer:  
'ImageGeneric_PhotoSmall');
         /Inline;

     ?>

If this doesn't produce an error, add in the two removed lines one at  
a time to see when the error occurs. If this *does* produce an error,  
let the list know and we'll take another look.


--
Douglas Burchard, President
DouglasBurchard.com, Web Applications
15024 NE 66th Street
Redmond, WA  98052, USA

direct: (206) 227-8161
[hidden email]
http://www.douglasburchard.com/


--
------------------------------
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: Saving an image from FMSA FMContainer into folder and name it

detlef.hebbel
In reply to this post by detlef.hebbel
Hi Douglas.

Fantastic! It works well:

I did your suggested step-by-step with no errors, than added the missing
lines - no error, but also no result. Than I added the second line
'Content_Type: 'image/jpeg';' as it was originally in Adam Randall's script,
and here we go.

Now I am able to not only view, but also save and manipulate all images from
FM Containers.

Thanks to you and the List for all your help. Mr Miles too!

Cheers

Detlef


     <?LassoScript
Content_Type: 'image/jpeg';

         Inline:
            -Database='db',
            -Table='tb',
                  -KeyValue=(Action_Param: 'id'),
                 -NoValueLists,
                 -Search;
             Var: 'filedata' = (Database_FMContainer:
'ContainerFieldName');

             Var: 'image' = (Image: -Binary=$filedata);
             $image -> (Save: 'images/MyImage.jpg', -Quality=(100));
         /Inline;

     ?>





on 25.05.2005 03:35, Douglas Burchard at
[hidden email] wrote:

> On May 23, 2005, at 9:56 PM, Detlef Hebbel wrote:
>
>> This looks promising, but I get an error:
>>
>> Error Message:
>> Error: Field not found or enabled.
>> at: FMContainer with params: 'ImageGeneric_PhotoSmall'
>> at: Admin/Vehicles/SaveImagesFromFMContainer.lasso on line: 25 at
>> position:
>> 30
>> at: inline with params: -Database='eMarketing_002', -
>> Table='VehiclesImages',
>> -KeyValue=1, -NoValueLists, -MaxRecords=1, -Search
>> at: Admin/Vehicles/SaveImagesFromFMContainer.lasso
>> Error Code:
>> -1
>>
>> All Lasso and file permissions are given and the field is on the
>> table and
>> the spelling is right!
>>
>> Any idea what to change?
>
> Hmm, I wouldn't have expected a problem with that line since you had
> working code before for serving the same data. Try taking out all of
> the code after the offending line (except closing containers) to see
> if the error changes. This might help better define the problem:
>
>      <?LassoScript
>
>          Inline:
>                  -Database = 'db',
>                  -Table = 'tb',
>                  -KeyValue = (1),
>                  -NoValueLists,
>                  -Search;
>              Var: 'filedata' = (Database_FMContainer:
> 'ImageGeneric_PhotoSmall');
>          /Inline;
>
>      ?>
>
> If this doesn't produce an error, add in the two removed lines one at
> a time to see when the error occurs. If this *does* produce an error,
> let the list know and we'll take another look.
>
>
> --
> Douglas Burchard, President
> DouglasBurchard.com, Web Applications
> 15024 NE 66th Street
> Redmond, WA  98052, USA
>
> direct: (206) 227-8161
> [hidden email]
> http://www.douglasburchard.com/
>



--
------------------------------
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