|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
File uploaded to server....How can I delete it?Hi,
I have uploaded an image to the web server using the code below. Note that 'FileUpload' is the name of my HTML input control. if (FileUpload.PostedFile != null) { String virtualPath = "~/uploads/" + Path.GetFileName (FileUpload.PostedFile.FileName); String phyiscalPath = Server.MapPath(virtualPath); FileUpload.PostedFile.SaveAs(phyiscalPath); } I save the physicalPath and virtualPath in SQL DB for image retrieval. QUESTION: How can I delete the image 'physically' from the web server if I dont need it any more?? System.IO.File.Delete
-Brock DevelopMentor http://staff.develop.com/ballen Show quoteHide quote > Hi, > > I have uploaded an image to the web server using the code below. Note > that 'FileUpload' is the name of my HTML input control. > > if (FileUpload.PostedFile != null) > { > String virtualPath = "~/uploads/" + Path.GetFileName > (FileUpload.PostedFile.FileName); > String phyiscalPath = Server.MapPath(virtualPath); > FileUpload.PostedFile.SaveAs(phyiscalPath); > } > I save the physicalPath and virtualPath in SQL DB for image retrieval. > > QUESTION: How can I delete the image 'physically' from the web server > if I dont need it any more?? >
Click checkbox's label - javascript onclick gets called twice
AutoPostBack How can I use my Own control in DataGrid? The nowrap Property of TD Tags Text control - password Using a Stylesheet in a User Control Referencing Datagrid Rows while Datagrid is Sorted TextBox.Text not getting the proper value Positioning Panel on WebForm at runtime error messages and focus |
|||||||||||||||||||||||