file_upload images->save

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

file_upload images->save

Viaduct Productions
Hi folks.

With regards to file_uploads that are receiving images, can you save  
files in the temp folder using image tags?  I've used file_copy and  
file_processuploads, but I thought that if you recognized the  
incoming file as an image, you could use the image tags.  This is  
what I want to do:

iterate(file_uploads, var('f'));
        // test for suffix to see that it is an image
        var('myName' = lasso_uniqueid);
        var('myImage' = image($f));
        $myImage->save('subdir/' $myName $myTerminus);
/iterate;

At the moment, this line returns a null type:

var('myImage' = image($f));

Any ideas appreciated.

Cheers


Rich in Toronto
...now go get on your bike


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

Reply | Threaded
Open this post in threaded view
|

Re: file_upload images->save

dguardiola

Le 11 mai 08 à 17:19, Viaduct Productions a écrit :

> Hi folks.
>
> With regards to file_uploads that are receiving images, can you  
> save files in the temp folder using image tags?  I've used  
> file_copy and file_processuploads, but I thought that if you  
> recognized the incoming file as an image, you could use the image  
> tags.  This is what I want to do:
>
> iterate(file_uploads, var('f'));
> // test for suffix to see that it is an image

for this part you could use mime-type rather than suffix

if: $f->(find:'type') >> 'image';

no idea for the rest though...I just save in another temporary upload  
folder of my own
I suppose it's still a permission issue,  doing things in /var/temp/  
seems difficult
--
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/

Reply | Threaded
Open this post in threaded view
|

Re: file_upload images->save

Viaduct Productions

On May 11, 2008, at 11:28 AM, Dominique Guardiola wrote:

> for this part you could use mime-type rather than suffix
>
> if: $f->(find:'type') >> 'image';

Good to know.  Thanks.

> no idea for the rest though...I just save in another temporary  
> upload folder of my own
> I suppose it's still a permission issue,  doing things in /var/
> temp/ seems difficult


I have half and half.  I just want to have abilities in this temp  
folder before I move to another folder, with set permissions, then  
having to delete the temp file.

Fletcher?  Any comment on the temp folder and doing lasso work on  
temp files?

Cheers



Rich in Toronto
...now go get on your bike


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

Reply | Threaded
Open this post in threaded view
|

Re: file_upload images->save

Bil Corry-3
In reply to this post by Viaduct Productions
Viaduct Productions wrote on 5/11/2008 10:19 AM:
>     var('myImage' = image($f));

$f is a map, so image(map) won't return an image.  You have to do this:

        var('myImage') = image($f->find('upload.name'));


The other issue is whether the image tag allows absolute file paths from root, which I don't know.  If it doesn't, you'll have to use the file tags to grab the content and build the image using it.


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

Reply | Threaded
Open this post in threaded view
|

Re: file_upload images->save

Doug Gentry
In reply to this post by Viaduct Productions
My understanding is that the temp file goes away automatically and  
quickly.  I think it would be better to move your image to a pending  
directory, with the kind of permissions you need, rather than working  
on the temp file.

...Doug

On May 11, 2008, at 8:32 AM, Viaduct Productions wrote:

>>
>
>
> I have half and half.  I just want to have abilities in this temp  
> folder before I move to another folder, with set permissions, then  
> having to delete the temp file.
>
> Fletcher?  Any comment on the temp folder and doing lasso work on  
> temp files?
>
> Cheers
>
>
>
> Rich in Toronto
> ...now go get on your bike
>



---
Doug Gentry
Dynapolis & Southern Oregon University
p:  541-261-8501 / Toll Free: 866-890-6013
[hidden email]
www.dynapolis.com - blog: www.plain-sense.com



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

Reply | Threaded
Open this post in threaded view
|

Re: file_upload images->save

Viaduct Productions
Yes, but after the page is completed.  So as long as you are on that  
page, doing stuff, I would like to be able to do as I choose, and  
have it not disappear once I copy it elsewhere. In this instance I  
have to copy it somewhere, manipulate it and copy it elsewhere, etc.


On May 11, 2008, at 1:00 PM, Doug Gentry wrote:

> My understanding is that the temp file goes away automatically and  
> quickly.  I think it would be better to move your image to a  
> pending directory, with the kind of permissions you need, rather  
> than working on the temp file.


Rich in Toronto
...now go get on your bike


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

Reply | Threaded
Open this post in threaded view
|

Re: file_upload images->save

Viaduct Productions
In reply to this post by Bil Corry-3
Ya just got past that part.  Also threw it into a temp folder, from  
which I'll use my image tags. Would be nice to use the floating temp  
file though.


On May 11, 2008, at 12:07 PM, Bil Corry wrote:

> $f is a map, so image(map) won't return an image.  You have to do  
> this:
>
> var('myImage') = image($f->find('upload.name'));
>
>
> The other issue is whether the image tag allows absolute file paths  
> from root, which I don't know.  If it doesn't, you'll have to use  
> the file tags to grab the content and build the image using it.


Rich in Toronto
...now go get on your bike


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