S
soul_chicken
I'm working on a simple image upload project using the asp:FileUpload
control. I read the file in and stick it into a clients content
management system. The problem is that once I redirect back to a view
page, the cached copy of the image from the content management system
is being returned. Hit "F5" and everything comes back as intended. I
can't make changes to the content management system but I would like to
eliminate the extra keystroke.
My thought was to create a simple webrequest object using the
System.NET.WebClient opbject and request the resource and at the end of
the upload. Basically just a screen scrape of that image url, and
programatically set the Cache-Control header to "no-cache". When I do
this however, the image returned is still the cached copy. Is there
any way to programatically simulate the action that is performed by the
"F5" keystroke?
Thanks,
S
p.s. - here's the code I'm using to do the web request...
Dim req As New System.Net.WebClient()
req.Headers = New System.Net.WebHeaderCollection()
req.Headers.Add(System.Net.HttpRequestHeader.CacheControl, "no-cache")
Dim aRequestedHTML() As Byte
aRequestedHTML = req.DownloadData(ImageUrl)
req.Dispose()
aRequestedHTML = Nothing
control. I read the file in and stick it into a clients content
management system. The problem is that once I redirect back to a view
page, the cached copy of the image from the content management system
is being returned. Hit "F5" and everything comes back as intended. I
can't make changes to the content management system but I would like to
eliminate the extra keystroke.
My thought was to create a simple webrequest object using the
System.NET.WebClient opbject and request the resource and at the end of
the upload. Basically just a screen scrape of that image url, and
programatically set the Cache-Control header to "no-cache". When I do
this however, the image returned is still the cached copy. Is there
any way to programatically simulate the action that is performed by the
"F5" keystroke?
Thanks,
S
p.s. - here's the code I'm using to do the web request...
Dim req As New System.Net.WebClient()
req.Headers = New System.Net.WebHeaderCollection()
req.Headers.Add(System.Net.HttpRequestHeader.CacheControl, "no-cache")
Dim aRequestedHTML() As Byte
aRequestedHTML = req.DownloadData(ImageUrl)
req.Dispose()
aRequestedHTML = Nothing