November Happy Hour will be moved to Thursday December 5th.

Expired media

Vote:
 

Hi,

I was pleased to see that an expiration date could be set on a media file (in this case a jpg). But I was surprised to see that a link to an expired image displays the image anyway. Our client wants media to automatically become unavailable after a certain date. How can this be achieved?

Thanks.

#118985
Mar 18, 2015 12:45
Vote:
 

Hi Pete, on my EPiServer 8 installation this work as expected. If you are logged in you are still able to see the image though. Could that be the problem?

#118986
Mar 18, 2015 13:05
Vote:
 

I tried logging out but still see the image. We are using 7.5, in particular 7.19.2 for EPiServer.CMS.Core

#118987
Mar 18, 2015 13:10
Vote:
 

How are you linking to the media?

Frederik

#118990
Mar 18, 2015 13:54
Vote:
 

It is a ContentReference in the model, set by the editor. Accessed in the cshtml; after checking:

 !ContentReference.IsNullOrEmpty(Model.SmallImage) 

it is used as follows:

<img src="@Url.ContentUrl(Model.SmallImage)" class="img-responsive">



#118991
Mar 18, 2015 14:03
Vote:
 

Hi!

My guess is that the image is cached in the browser. Try clearing the cache or using Ctrl-F5 to hard-reload the page.

#119017
Mar 19, 2015 8:47
Vote:
 

Thanks Linus, I guess the problem must have had something to do with that. Although, oddly enough, I am unable to recreate the anomaly (I tried resetting the image as unexpired, got it in the browser, then reset it to expire in a few minutes; after that time a simple refresh and the image disappeared. )

#119036
Mar 19, 2015 15:03
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.