473,791 Members | 2,985 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Image File Not getting Deleted (IO Exception)

Hi All,
I am creating an image(.gif) file on server Using ASP and ShotGraph
Third Party Tool, now with the help of this .gif image I am creating
another Thumbnail image in ASP.NET.
Now this newly created Thumbnail is been shown in ASP.NET page in
IFrame, I have delete Button in my ASP.NET page, Now on Click of this
Delete Button i want to delete both the images.
But I am not able to delete that .gif file which is been created by
ASP page using ShotGraph, it gives me IO Exception, it says that "files
is been used by another process".

So how can i delete this file from my ASP.NET code(i am using VB.NET as
code base).

Please help me out.

Thanks in Advance

Manoj Singh.

Jun 1 '06 #1
5 1353
> But I am not able to delete that .gif file which is been created by
ASP page using ShotGraph, it gives me IO Exception, it says that
"files is been used by another process".


Make sure, no other process has this picture opened. I can just guess,
as I don't have any insight in your code, but maybe you are opening the
image with
Image img = Image.FromFile( ...);
and then you never dispose the image with
img.Dispose();
So a reference to the image is kept and so it is still marked as "in use".

Two solutions:
1) Call dispose whenever you open an image.
2) Use Image.FromStrea m() instead of Image.FromFile( )

hope I am good in guessing... try to give more information on your
questions for not letting us guess!

hope to help anyways
Markus
Jun 1 '06 #2
Aryan,

In addition to Markus (although this is winform code)

http://www.vb-tips.com/default.aspx?...9-d436c3b242c1

I hope this helps,

Cor

"Aryan" <ma*********@gm ail.com> schreef in bericht
news:11******** *************@f 6g2000cwb.googl egroups.com...
Hi All,
I am creating an image(.gif) file on server Using ASP and ShotGraph
Third Party Tool, now with the help of this .gif image I am creating
another Thumbnail image in ASP.NET.
Now this newly created Thumbnail is been shown in ASP.NET page in
IFrame, I have delete Button in my ASP.NET page, Now on Click of this
Delete Button i want to delete both the images.
But I am not able to delete that .gif file which is been created by
ASP page using ShotGraph, it gives me IO Exception, it says that "files
is been used by another process".

So how can i delete this file from my ASP.NET code(i am using VB.NET as
code base).

Please help me out.

Thanks in Advance

Manoj Singh.

Jun 1 '06 #3
Hello Friends,
I am not Using that .gif image any where other then creating
Thumbnail Image from it. So my ASP code creates that gif image and then
sends the path of that .gif image to ASP.NET page and then ASP.NET page
creates Thumbnail Image from that original gif image. And now this
newly created Thumbnail Image is been shown in IFrame.
So problem is, i am able to delete that newly created Thumbnail
Image, but that old gif image is not getting deleted. So at this point
i am getting error. And i am closing and disposing all the objects
which creates that Thumbnail Images
Thanks All of You,
Manoj Singh.

Jun 1 '06 #4
Plus if all else fails, it could be caused by IIS (AFAIK files are locked
for short period of time when displayed through IIS).

--
Patrice

"Aryan" <ma*********@gm ail.com> a écrit dans le message de news:
11************* ********@f6g200 0c...legrou ps.com...
Hi All,
I am creating an image(.gif) file on server Using ASP and ShotGraph
Third Party Tool, now with the help of this .gif image I am creating
another Thumbnail image in ASP.NET.
Now this newly created Thumbnail is been shown in ASP.NET page in
IFrame, I have delete Button in my ASP.NET page, Now on Click of this
Delete Button i want to delete both the images.
But I am not able to delete that .gif file which is been created by
ASP page using ShotGraph, it gives me IO Exception, it says that "files
is been used by another process".

So how can i delete this file from my ASP.NET code(i am using VB.NET as
code base).

Please help me out.

Thanks in Advance

Manoj Singh.

Jun 1 '06 #5
Hello Friends,
Thanks for all your help and support. With your help i could solve my
problem.

Thanks Again
Manoj Singh.

Jun 1 '06 #6

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

Similar topics

6
5304
by: Kiran | last post by:
Hi, I have program, which opens file at the startup and logs error messages to the file, file handle is closed at the end of the program. However if file is deleted in-between, program do not report any error while writing to the open file handle. On Windows, file shows-up again in explorer and automatically deleted finally when program ends. On Unix, same thing happens if file is on nfs mounted drive, but in this case, actual file is...
1
10140
by: sympatico | last post by:
Hi, I am trying to compare 2 images to check if they are exactly identical (in terms of data), I thought this would be quicker than analysing pixels of the images. I have found lots of examples for encrypting text strings using MD5 hash, but I cannot find a way to get this to work with images that exist in picture boxes. I am trying to get a hash for the image file, but not from the file but from the picture box as there is some editing...
3
2827
by: Scott | last post by:
Hello, I am running into a problem with my code and can't seem to figure out the solution. I know it has to do with the pciture box control and unloading the image inthe picture box but I can't seem to figure out the correct way to "unload" the file. I have a simple form with a picture box and a button. I am using dir() to get all the the .tif files and display them in the pciture box. Each time the button it pressed it displays the...
0
1443
by: Waqas.L.Khan | last post by:
Hi guys, I have a problem when trying to create an image file. Basically my code takes any file and gets it's system icon using SHGetFileInfo and then saves the file either by converting it into a bmp and saving to disk or by saving the icon using a filestream. In both cases saving the file works fine. However, when I open the newly created file from explorer I notice something peculiar. The file has a black background. I would have...
4
3395
by: FrankMeng | last post by:
When I tried to load 2GB tiff file, I got an "out of memory" error. I have 512MB memory, but I set virtual memory to 5GB. Is it possible to cut the big tiff file into several sub-images without loading the whole image?
2
2813
by: amritranjan | last post by:
This is my Jsp code for image upload in database: -----------Upload.jsp---------------- <html> <head> <title>Account Details </title> </head> <body bgproperties="fixed" bgcolor="#CCFFFF"> <form method="POST" action="UploadPicture.jsp" enctype="multiform/form-data">
0
2557
by: hnpatel | last post by:
hello friends, i m making application in vb.NET. i m using MY SQL 5.0 and vs 2005 for this application. Now I want to save image file in sql database. i m using blob datatype of image field. i want to save image file from vb.net form. i m getting image in picturecontrol through openfiledialogbox. now how to save this image in my database through insert query? Plz help me for this..... Thanx in advance.....
2
1595
by: =?Utf-8?B?SmVmZlAtPg==?= | last post by:
I want to retrieve an image file (TIF) convert it to a bmp file and enable sizing. I know how to do the converting & sizing part, and store any atributes to file location in the webconfig, what I don't know is how to get the image file. The only way that I've got it working was to Impersonate a user login at the other server.
3
4434
by: premprakashbhati | last post by:
hi, good evening.. i am going to upload an image in a web form .....for that iam using HTML input(file) control and one web control button i.e., Upload_Button() here is the code ...its work fine when iam using a normal web page... but can't in content page.... Code in Master Page <%@ Master Language="C#" AutoEventWireup="true" CodeFile="submaster.master.cs" Inherits="submaster" %> <%@ Register Assembly="AjaxControlToolkit"...
0
9669
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10427
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10207
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10155
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9029
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7537
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6776
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5431
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3718
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.