Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6551303
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:19:18+00:00 2026-05-25T12:19:18+00:00

I have saved an image to a byte[] in a command object and wish

  • 0

I have saved an image to a byte[] in a command object and wish to display it in the next stage of the createFlow webflow.

I am trying to steer clear of using the file system and / or database system for storing the image during the webflow.

Typically, to view the image, I would call renderImage from the gsp:

class ArtefactController {

    def createFlow = {
       ............
    }

def renderImage = {

    def ArtefactInstance = Artefact.findById(params.id)
    if(ArtefactInstance?.image) {
        response.setContentLength(ArtefactInstance.image.length)
        response.outputStream.write(ArtefactInstance.image)
    }
    else {
        response.sendError(404)
    }
}

however for the webflow when I try to call renderFlowImage from a gsp:

def renderFlowImage = {
    if(flow.artefactCommand?.image) {
        response.setContentLength(flow.artefactCommand.image.length)
        response.outputStream.write(flow.artefactCommand.image)
    }
    else {
        response.sendError(404)
    }
}

The flow scope in not accessable.

Any suggestions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T12:19:19+00:00Added an answer on May 25, 2026 at 12:19 pm

    I assume you’re hitting the renderFlowImage action in your flow’s view with a second http request via an img tag such as:

    <img src="${createLink(action:'renderFlowImage')}" />
    

    This won’t work because, for one thing, you need to pass in a ‘flowExecutionKey’ which grails uses to match a request with a flow.
    It is possible to work around this, but you might be better off just rendering the image during the rendering phase of your flow’s next view with a data URI in the img tag. You could do this easily with the rendering plugin, which provides some handy tags (among other things) to render inline images using a data uri.
    So in the next flow view, you could replace the existing img tag with a call to one of the rendering plugin’s ‘inline’ tags:

    <rendering:inlineJpeg bytes="${artefactCommand.image}" /> 
    

    But be careful – there are some limitations to the data URI approach to be aware of (see http://www.7cynics.com/webdesign/css/css-inline-images-data-uri.html).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have saved an image on the database and want to display it to
I have a PictureBox control I want to display an image in it. I
I have the following code which takes an improperly saved Image from the database
It's me your junior programmer extraodinaire I'm trying to display an image from my
I have been trying to read a picture saved in Access DB as a
I have saved an image in database using following code. ofd.ShowDialog() vrPicHolder = IO.File.ReadAllBytes(ofd.FileName)
i have image value in database of type image . in view saved under
I have a byte array representation of a Image. How to save it on
I have a save as image feature for charts in my application. The chart
I have written code in Java to access web cam,and to save image... I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.