Also, you are reusing the same variable objBmp, just use the .Dispose() and set to Nothing in the first instance use as well and see.
Main Topics
Browse All TopicsI have an ASP.Net file upload script that I use to upload and resize an image. It also creates a thumbnail. The problem is that if I try to upload a different image to replace the one I just uploaded I get an error. When I go to my FTP and try to delete it I get a permission denied. I can delete the file the next day though.
From what I can tell my script doesnt release the file immediately. Can someone take a look at my script and tell me what I am missing?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
I get an error that the variable objBitmap is not a variable when I try to dispose of it.
When I try to delete files with my FTP program it is the thumbnail and the original that I can't delete.
Someone suggested using a differtent name each time but that wont work since the images are named for the product or property. I am using this script in two different sites. On two different servers but with the same hosting company.
Business Accounts
Answer for Membership
by: CB_ThirumalaiPosted on 2009-01-24 at 05:30:22ID: 23456287
full, originalimg, thumb all use the .Dispose() and set those to Nothing as well, is it from the objBmp Save that is locking the file, and if so, just try using objBmp = Nothing for it too and see.