.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
satyapriyanayak
SP
Sambanthamoorthy
Swati Kadam
rosgeppe
Post New Web Links

how to delete image from particular folder in c#,net

Posted By:      Posted Date: October 09, 2010    Points: 0   Category :ASP.Net
 

hi everyone

i m uploading the photo using file upload control.

now if i want to delete that photo from photo folder how can i do that?

can anyone help?

thanks

shweta




View Complete Post


More Related Resource Links

Programmatically delete a .webpart file from wpcatalogs folder from an IIS website

  

We are using a third party wsp in our solution which directly adds the web parts into the web application store rather than the web part gallery(References to them are present in IIS site's wpcatalog directory). We want to remove these web part files so that the users will not be able to add these web parts to pages directly. Or any other modification so that users will not be able to add these directly. Is there a way we can do this programmatically?


Saving Image File in a Folder on Sever from Client Machine using Sql Server

  
  Hi EveryOne... Can anyone help me Saving an Image file in a Server folder from a client machine using Sql server 2005....   

grid view image delete problem

  
i have a grid in which i am showing a record with image, when user delete the record the image also deleted and when it again enter the record it upload the new image but display the deleted image from the cache example: name.jpeg upload, then deleted, a different file with the name.jpeg upload, it showing the deleted one. 

Delete bin and obj folder from projects directories

  
You always have problem to debug when you do latest from source control.You might end up deleting bin/obj folder sometime.Here is nice bat file which delete bin/obj folder(s). 1. copy this on notepad and save it as clean.bat file 2. Keep this file on root directory 3. Double check the directory on "DIR /B /AD /S obj" and "DIR /B /AD /S bin" ---------------------------------------------------------------------------------------------- FOR /F "tokens=*" %%G IN ('DIR /B /AD /S bin') DO RMDIR /S /Q ...(read more)

How to delete an image file assigned to a PictureBox xontrol ?

  
In a Windows form application, some image files are assigned to PictureBox controls. I am trying to delete those image files. The first approach [1] with "Image.FromFile" gives an error message of "Another process is using this image file", although "Image.Dispose()" is executed. The second approach [2] using "Image.FromStream" results (X) images for PictureBoxes and Buttons, if "fs.Close()" is inclided. Without "fs.Close()", it gives the same error message of "Another process is using...". How can I display images properly and delete those images files ? Thanks [1] pictureBoxSelected.Image = Image.FromFile(@actualImage); . . . pictureBoxSelected.Image.Dispose(); pictureBoxSelected.Image = Image.FromFile(@tempImage);                                                if (System.IO.File.Exists(actualImage) == true) {     System.IO.File.Delete(actualImage); } [2] FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read); pictureBox.Image = System.Drawing.Image.FromStream(fs); fs.Close();

Delete image in asp.net 2.0

  
Detete images in asp.net 2.0fileupload.save as("")How about  delete ?

How Do You Insert An Image From The Image Folder Into A Binary Column?

  
Hello Forum, How would I go about inserting an image that's in my images folder into a sql table column of datatype varbinary(MAX) ?    Thank you

Users can delete the parent folder even when they don't have delete permission on subfolders

  
I'm trying to use a document library to manage project documents. I created a folder for each project, and under the project folder, there are two subfolders with special permissions for confidential documents. I give normal users the Contribute permission of the project folders so they can add/remove new subfolders under the projecct folder. However, with this configuration the normal users can delete the whole project folder in the web interface, even they don't have delete permission for the two subfolders. Is there a way to prevent this? Regards, James Liang

Share an image folder between 2 web projects (MVC2)

  

Hi,

 

I'm searching an answer to this question on the web for 2 weeks unsuccessfully.

I'm sure I'm not the only one to wondering about that!

I have two web projects MVC2: a FrontOffice and a BackOffice.

The user has to be able to upload some image in the BackOffice, which will be display on the FrontOffice and vice versa.

 

How can I share an image folder between these two projects?

Has the folder to be necessary in the solution or can it be somewhere else on the server?

My team and I are working with TFS.

I want to create an image folder in which we can write and read from frontoffice and backoffice.

But I don't want to have to do a "get latest version" everytime someone is adding an image in the folder. I would like to create a folder on the server we can access from the backoffice AND the frontoffice with reading and writing rights in real time.

 

I'm not sure to be very clear...

 

Thanks

 

PatachouNewG


how to delete more than 1 image in gridview ??

  

hi

 

I have  a gridview on my page which is bound to an objectdatasource that gets Data from an Images Table in my database.

 

The delete button is enabled and I have this code in my DAL.

 

DELETE FROM [Images] WHERE (([ImageId] = @ImageId))

 

Instead of deleting just 1 image, I want to give a user the option to delete multiple images at once.

 

Any code showing how to do this in c sharp be  grateful.

 

thanks

 

P

 


save image in new folder

  

i have a image which i am picking from open file dialog now i want to save image in my project folder

please hep me


how to delete files from folder in webserver

  

hi i m using fileupload concept and saving the files to a folder download.hw can i check the files names saved in that folder while site is hosted on webserver.is there any way to delete some of files from that folder runtime. 


Image Upload Fails- access denied to folder

  

i am trying to use a fileopen dialog to select an image and copy it to my project folder .

i have used this code to do that.

OpenFileDialog ofd = new OpenFileDialog();
      ofd.Filter = "All Image Files| *.*";
      if(ofd.ShowDialog()==true)
      {
        if(!string.IsNullOrEmpty(ofd.FileName))
        {
          imgImagePath.Source=new BitmapImage(new Uri(ofd.FileName,UriKind.RelativeOrAbsolute));
          FileStream fs = new FileStream(ofd.FileName,FileMode.Open,FileAccess.Read);
          FileStream copyfs = new FileStream(@"../../Themes/Images", FileMode.CreateNew, FileAccess.Write);
         
          if(copyfs.CanWrite)
          fs.CopyTo(copyfs);
          
        }
      }

The Error i am gettin is The so and so folder access is denied.

I have check that the folder is not read only. and its in d:

Any suggestions?

 


Delete images from folder physically in vb.net

  

I am using grid view and on grid delete image click i remove product but i also want to remove image phisically from the folder.

i have deleted logically but i need code to delete from folder ?

VB.NET 

 

 

Regards

Hafiz Awais

 


Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend