Upload an image and display it immediately

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Upload an image and display it immediately

BrunoBB
Hi,

I want to upload and image (that is temporally stored on server disk) and
display it immediately but without adding the image to any WAFileLibrary.

These image are store let say in 'c:/temp' (win) or '/home/tmp' (linux) but
are temporal.
The life span is not more than an hour.

I know how to do it but add in it to a WAFileLibrary but i do not want that
because they are temporal.

Still researching on this ...

regards,
bruno



--
Sent from: http://forum.world.st/Seaside-General-f86180.html
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Upload an image and display it immediately

BrunoBB
Hi,

Actually i think this is not possible with Seaside (to serve an image
without WAFileLibrary).

So i think the best approach is to:
1) Upload the image from Seaside
2) Copy the image to a virtual directory
3) Set Reverse Proxy to server the virtual directory of 3). (this step it
should be the first step :)
4) From Seaside create a image tag with url of 3) (the image served by the
RP).

regards,
bruno




--
Sent from: http://forum.world.st/Seaside-General-f86180.html
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Upload an image and display it immediately

Karsten Kusche
Hi Bruno,

You can very well return any kind of data from any responder. There’s nothing to stop you from having a callback block and in there do something like self requestContext respond:[:response| response ... ]. 

There you can do the same as what WAFileLibrary does: provide a document with mime-type, etc. if you set the content disposition you can even customize the filename. 

Kind regards
Karsten



Georg Heeg eK
Wallstraße 22
06366 Köthen

Tel.: 03496/214328
FAX: 03496/214712
Amtsgericht Dortmund HRA 12812


Am 31. Juli 2019 um 16:44:10 MESZ schrieb BrunoBB <[hidden email]>:
Hi,

Actually i think this is not possible with Seaside (to serve an image
without WAFileLibrary).

So i think the best approach is to:
1) Upload the image from Seaside
2) Copy the image to a virtual directory
3) Set Reverse Proxy to server the virtual directory of 3). (this step it
should be the first step :)
4) From Seaside create a image tag with url of 3) (the image served by the
RP).

regards,
bruno




--
Sent from: http://forum.world.st/Seaside-General-f86180.html
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Upload an image and display it immediately

BrunoBB
Karsten,

Thanks very much for the pointer.
Initially we store the image in the server but for security reason now all
is in memory.

It was more easy that i initially though, just:
html image document: aImageByteArray mimeType: 'image/png'. "for png files"

regards,
bruno





--
Sent from: http://forum.world.st/Seaside-General-f86180.html
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside