0

I am using a third party component which generates 3 images at the same time, these 3 images all need to be returned to the same page.

In the old Asp.Net product the 3 images were created, stored in the Application, then handlers would return the 3 images and remove them.

In the new Asp.Net MVC solution I can create an image and return a FileContentResult, but this would only be for one image and I need to return 3. The only way I can see to do this is to do what the old solution did and store it.

Is there a better way of doing this, or at least a better place to store the images? Possibly the cache?

Incidentally we use sql session so I don't think the session would be a good idea

(Additional detail): I will be targetting both desktop and mobile platforms

Thanks

tony
  • 2,178
  • 2
  • 23
  • 40
  • Do you want to return this images for vizualization or download? – Fals Jan 13 '15 at 13:19
  • [Data URI](http://en.wikipedia.org/wiki/Data_URI_scheme)s? – Damien_The_Unbeliever Jan 13 '15 at 13:21
  • Data URIs: "This technique allows normally separate elements such as images and style sheets to be fetched in a single HTTP request rather than multiple HTTP requests, which can be more efficient." Never heard of them before but based on that description they sound ideal – tony Jan 13 '15 at 13:22
  • be aware of Data URI - it migth not work in IE if your file too big. – teo van kot Jan 13 '15 at 13:24
  • Then again: http://stackoverflow.com/questions/6819314/why-use-data-uri-scheme "On Mobile, Data URIs are 6x Slower " – tony Jan 13 '15 at 13:25
  • I will be targeting desktop and mobile – tony Jan 13 '15 at 13:27
  • One idea might be to return one 1 image, but then use css to dissect it. However the image sizes wouldn't be constants so I have the similar problem of how to return the image sizes – tony Jan 13 '15 at 13:31
  • you could use ajax to make 3 requests to return 3 files – DLeh Jan 13 '15 at 13:48
  • That's what I am doing, the question is regarding the best place to store it after it is generated, or an alternative technique altogether – tony Jan 13 '15 at 13:52
  • Personally, I would generate the images and then return a collection of paths to the view. Then use that to add `img` tags for each image. – Chris Pratt Jan 13 '15 at 14:56
  • And where do you store the images? – tony Jan 13 '15 at 15:01

0 Answers0