|
View:
New views
6 Messages
—
Rating Filter:
Alert me
|
|
|
Serve:-File='' not workingHi,
I am trying to use the (Serve) tag from http://www.lassosoft.com/Documentation/TotW/index.lasso?9177 It works on Filemaker images but does not work when I use it on files. I only get an emtpy image. I try to use it like this: [var:'url' = (Serve: -File='../fm/bilder/'(field:'recordid')'.jpg')] <img src="[$url]" alt="" /> I have checked the path to the picture and it is correct. Does this not work on Lasso 8.5.5? /asle benoni -- This list is a free service of LassoSoft: http://www.LassoSoft.com/ Search the list archives: http://www.ListSearch.com/Lasso/Browse/ Manage your subscription: http://www.ListSearch.com/Lasso/ |
|
|
Re: Serve:-File='' not workingAsle Benoni wrote on 7/21/2008 2:52 PM:
> [var:'url' = (Serve: -File='../fm/bilder/'(field:'recordid')'.jpg')] > <img src="[$url]" alt="" /> If the image is sitting on the drive, is there a reason you don't just use plain ol' HTML like this? <img src="'../fm/bilder/[field:'recordid'].jpg'" alt="" /> - Bil -- This list is a free service of LassoSoft: http://www.LassoSoft.com/ Search the list archives: http://www.ListSearch.com/Lasso/Browse/ Manage your subscription: http://www.ListSearch.com/Lasso/ |
|
|
Re: Serve:-File='' not workingHi,
I was hoping this could resize the image before it was displayed. The original images are over 500kb each. That is what the tag does also? And the image size should be smaller to the browser. Or am I in a wrong direction? I want to serve around 50kb to the client. /asle benoni Den 21. juli. 2008 kl. 22.26 skrev Bil Corry: > Asle Benoni wrote on 7/21/2008 2:52 PM: >> [var:'url' = (Serve: -File='../fm/bilder/'(field:'recordid')'.jpg')] >> <img src="[$url]" alt="" /> > > If the image is sitting on the drive, is there a reason you don't > just use plain ol' HTML like this? > > <img src="'../fm/bilder/[field:'recordid'].jpg'" alt="" /> > > > - Bil > > > -- > This list is a free service of LassoSoft: http://www.LassoSoft.com/ > Search the list archives: http://www.ListSearch.com/Lasso/Browse/ > Manage your subscription: http://www.ListSearch.com/Lasso/ > -- This list is a free service of LassoSoft: http://www.LassoSoft.com/ Search the list archives: http://www.ListSearch.com/Lasso/Browse/ Manage your subscription: http://www.ListSearch.com/Lasso/ |
|
|
Re: Serve:-File='' not workingAsle Benoni wrote on 7/21/2008 5:03 PM:
> I was hoping this could resize the image before it was displayed. The > original images are over 500kb each. > That is what the tag does also? And the image size should be smaller to > the browser. Or am I in a wrong direction? I want to serve around 50kb > to the client. I've never used [serve], but you can achieve the same effect using [file_serve] and [image]. Given the age of that TotW, it may be [serve] just needs to be tweaked to work in LP8.5.5. - Bil -- This list is a free service of LassoSoft: http://www.LassoSoft.com/ Search the list archives: http://www.ListSearch.com/Lasso/Browse/ Manage your subscription: http://www.ListSearch.com/Lasso/ |
|
|
Re: Serve:-File='' not workingSounds good. Anyone have a code chunk that does this with Lasso?
I used the image.lasso trick since file_serve aborts the page but not sure how to reference it with a file instead of a image field. Do I store the image in a temp file->convert it -> use file_serve on the temp image? I do it with php or perl but this is new to me in Lasso. /asle benoni Den 22. juli. 2008 kl. 00.59 skrev Bil Corry: > Asle Benoni wrote on 7/21/2008 5:03 PM: >> I was hoping this could resize the image before it was displayed. >> The original images are over 500kb each. >> That is what the tag does also? And the image size should be >> smaller to the browser. Or am I in a wrong direction? I want to >> serve around 50kb to the client. > > I've never used [serve], but you can achieve the same effect using > [file_serve] and [image]. Given the age of that TotW, it may be > [serve] just needs to be tweaked to work in LP8.5.5. > > > - Bil > > > -- > This list is a free service of LassoSoft: http://www.LassoSoft.com/ > Search the list archives: http://www.ListSearch.com/Lasso/Browse/ > Manage your subscription: http://www.ListSearch.com/Lasso/ > -- This list is a free service of LassoSoft: http://www.LassoSoft.com/ Search the list archives: http://www.ListSearch.com/Lasso/Browse/ Manage your subscription: http://www.ListSearch.com/Lasso/ |
|
|
Re: Serve:-File='' not workingAsle Benoni wrote on 7/22/2008 5:27 AM:
> Sounds good. Anyone have a code chunk that does this with Lasso? > I used the image.lasso trick since file_serve aborts the page but not > sure how to reference it with a file instead of a image field. > Do I store the image in a temp file->convert it -> use file_serve on the > temp image? First thing to understand is you're going to have two pages, one that links to the image and one that serves the image. So to link to the image, you'd do something like this: <img src="../fm/bilder/image.lasso?[encode_url(lp_var_pack(field('recordid'),'secretpassword'))]" alt="" /> That will create a link with the recordid encrypted. Then create a file called "image.lasso" at that path that looks like this: if(client_getparams->size); var('fileName') = ''; protect; var('fileName') = lp_var_unpack(client_getparams->get(1),'secretpassword'); /protect; if($fileName->size == 0); 'Sorry, file not found.'; abort; /if; $fileName += '.jpg'; var('fileData') = bytes; protect; $fileData = file_read($fileName); /protect; if($fileData->size == 0); 'Sorry, file not found.'; abort; /if; local('imageData') = bytes; protect; $imageData = image(-binary=$fileData); $imageData->scale(-height=100, -thumbnail); $imageData = $imageData->data; $fileData = $imageData; // this line will run only if there isn't an error /protect; file_serve($fileData,-file=$fileName,-type=mime_type($fileName),-inline); /if; 'Sorry, file not found.'; abort; That will serve the image scaled to a height of 100. You don't have to use lp_var_pack and _unpack, you can just pass the raw ID; but that does make the images open to sequential polling. Those ctags are at tagSwap.net. - Bil -- This list is a free service of LassoSoft: http://www.LassoSoft.com/ Search the list archives: http://www.ListSearch.com/Lasso/Browse/ Manage your subscription: http://www.ListSearch.com/Lasso/ |
| Free Forum Powered by Nabble | Forum Help |