473,503 Members | 1,694 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Error when sending a graphic by setting Response.ContentType

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.

Dec 18 '07 #1
0 965

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
2088
by: Jay Douglas | last post by:
Hello all, I have a asp.net page that creates a pdf on the fly and sends the pdf down to the browser. When calling the page up in IE the Page_Load event is fried twice. This doesn't happen with...
2
1430
by: Matt Mercer | last post by:
Hi all, Well, thanks to some smart/helpful people here my upload and download section of my website works great! I am allowing users to upload directly into the SQL database but files cannot...
10
2275
by: James | last post by:
Hello, as this falls under both VB and PHP I have posted this into two newsgroups (this is the first time I've done this so if it is mucked up then I'm sorry). Anyway I want to make some simple...
1
3877
by: Billy | last post by:
Hi All, I'm attempting to use the MapNetworkDrive <snippedbelow from entire code below with very poor performance results. Basically, I have very small 73kb text files that are rewritten daily...
17
9442
by: mansb2002 | last post by:
Hi, We recently moved our webserver from Win2K to Win2003. The application works fine. Only problem is that when user views a report as a PDF, IE does not show it. The following code is used to...
0
837
by: Nathan Sokalski | last post by:
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,...
1
1512
by: franciros | last post by:
Hi, I've the problem with data array generated for query. The graphic include only first record, not all records. Why? This is the code in the my asp page: <%@ language="vbscript" %>...
7
3749
by: Jason1983 | last post by:
Hello sir, When iam trying to send emails to my user accounts which are gmail id's using my application it is giving me this error. Here is the error... Server object error 'ASP 0177 : 800401f3'...
10
6931
by: happyse27 | last post by:
Hi All, I got this apache errors(see section A1 and A2 below) when I used a html(see section b below) to activate acctman.pl(see section c below). Section D below is part of the configuration...
0
7202
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7086
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7332
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6991
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7462
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5578
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5014
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
1512
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
736
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.