Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Error when sending a graphic by setting Response.ContentType

Reply
Thread Tools

Error when sending a graphic by setting Response.ContentType

 
 
Nathan Sokalski
Guest
Posts: n/a
 
      12-18-2007
I am using an *.aspx page with a querystring to access graphics that I am
using in rollovers. I am using Response.ContentType and using
Response.WriteFile(). This sends the graphic perfectly fine, and in most
cases would work perfect. However, there are situations that I am running
into in which I want to delete the graphic file. When I try to do this, even
if a different rollover was the last one to use the page, I recieve a "The
process cannot access the file because it is being used by another process."
error. Is there something else I need to do? Here is my code:

Partial Public Class FileReader : Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
Dim filepath As String = Request.QueryString("filepath").Replace("|"c,
"\"c)
Dim mimetype As String =
My.Computer.Registry.ClassesRoot.OpenSubKey(My.Com puter.FileSystem.GetFileInfo(filepath).Extension). GetValue("Content
Type").ToString().ToLower()
Response.ClearContent()
Response.ContentType = mimetype
Response.WriteFile(filepath)
Response.End()
End Sub
End Class

I appreciate any help possible. Thanks.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
problem sending mail: Sending the email to the following server failed Luke Java 2 03-15-2007 10:54 AM
Is it possible to mouseover a GRAPHIC . . . that launches another (freestanding) GRAPHIC (ie. when flash is _not_ available)? 50 SOMETHING GAL HTML 3 12-10-2006 01:10 AM
pls help me when i sent mail, it vil sending twice instead of once ,am using java.mail,am sending my code.... shailajabtech@gmail.com Java 0 09-28-2006 06:38 AM
UDP socket, need help setting sending port Sells, Fred Python 3 12-22-2005 08:19 PM
Setting Focus to a position in a graphic knightowl Javascript 3 03-09-2005 12:32 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57