Top

Home Page

Railo / ColdFusion – Writing Image to Outpout Stream

Hello guys, Needed to do this for a project my team is maintaining, but I could only find the solution for ColdFusion, which looks like this: JavaImport = structNew(); JavaImport.io = structNew(); JavaImport.io.File = CreateObject('java', 'java.io.File'); JavaxImport = StructNew(); JavaxImport.imageio = StructNew(); JavaxImport.imageio.ImageIO = CreateObject('java', 'javax.imageio.ImageIO'); imageBuffer = JavaxImport.imageio.ImageIO.read(JavaImport.io.File.Init(imagePath)); response = getPageContext().getFusionContext().getResponse(); response.setHeader('Content-Type', 'image/png'); response.setHeader('Cache-Control', 'max-age=604800, public'); JavaxImport.imageio.ImageIO.write(imageBuffer, "png", response.getResponse().getOutputStream() ); After consulting Railo documentation on GetPageContext method, we've come to the following result: JavaImport = structNew(); JavaImport.io = structNew(); JavaImport.io.File = CreateObject('java', 'java.io.File'); JavaxImport = StructNew(); JavaxImport.imageio = StructNew(); JavaxImport.imageio.ImageIO = CreateObject('java', 'javax.imageio.ImageIO'); imageBuffer = JavaxImport.imageio.ImageIO.read(JavaImport.io.File.Init(imagePath)); response = getPageContext(); response.setHeader('Content-Type', 'image/png'); response.setHeader('Cache-Control', 'max-age=604800, public'); JavaxImport.imageio.ImageIO.write(imageBuffer, "png", response.getResponseStream() ); How it will be useful to you as well....

Hello guys, Needed to do this...

Read More

IP/TCP/UDP header vs C/C++

NOTE: This article is written in Romanian, for a translation please add me a comment.

Ei bine… nu mare imi fu uimirea dupa ultimile proiecte / teme, mici aplicatii. Uimirea ca habar nu am sa scriu un header tcp. Toata povestea a plecat de la o tema pentru facultate. Un modul de kernel linux/windows care trebuia sa filtreze pachetele TCP si UDP.