Advertisement

07.07.2008 at 01:23AM PDT, ID: 23542672
[x]
Attachment Details

cannot delete a file

Asked by brillox in Programming for ASP.NET, Microsoft Visual Basic.Net

Tags: ,

Hi Experts,

I need to have users be able to delete files froma  specific folder (webs erver is running on windows 2003 IIS 6)
I added the NETWORK SERVICE as user with full control permission.

what I experience is that if for example I logon to the website , add a file and then try to delete it, I can; however if I try to delete a file uploaded from another user, I cannot delete it .

I attached teh code I am using to delete the file (in this case an image)Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
Protected Sub ButtonDeleteImage_Click(ByVal sender As Object, ByVal e As System.EventArgs)
 
        Me.LabelMessageImage.Text = ""
        Dim ImgName As String = Me.LabelFileName.Text
 
        If ImgName IsNot Nothing Then
 
 
            Dim FilePath As String = Request.PhysicalApplicationPath & "Images/Uploaded/" & ImgName
 
            File.Delete(FilePath)
 
            If File.Exists(FilePath) Then
                Me.LabelMessageImage.Text = "Image has NOT been deleted"
            Else
 
                Me.ListBoxImages.DataSource = Getfiles(Request.PhysicalApplicationPath & "Images/Uploaded/")
                Me.ListBoxImages.DataBind()
                Me.LabelMessageImage.Text = "Image has successfully deleted"
                Me.LabelImgUrlForLink.Text = ""
            Me.LabelFileName.Text = ""
            Me.LabelTotalImages.Text = "Total Number of Images stored is: " & Me.ListBoxImages.Items.Count.ToString
 
            End If
        Else
            Me.LabelMessageImage.Text = "Please Select the image by clicking on the above list"
        End If
 
    End Sub
[+][-]07.07.2008 at 03:55AM PDT, ID: 21943911

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.07.2008 at 04:19AM PDT, ID: 21944004

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.07.2008 at 04:40AM PDT, ID: 21944096

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.07.2008 at 04:58AM PDT, ID: 21944208

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.07.2008 at 05:09AM PDT, ID: 21944273

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.07.2008 at 05:13AM PDT, ID: 21944298

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Programming for ASP.NET, Microsoft Visual Basic.Net
Tags: asp.net vb.net, Access to the path 'xxxxxx' is denied.
Sign Up Now!
Solution Provided By: ajaysharmaapjs
Participating Experts: 2
Solution Grade: A
 
 
[+][-]07.07.2008 at 05:24AM PDT, ID: 21944357

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.07.2008 at 06:02AM PDT, ID: 21944572

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628