Welcome, Guest
Username: Password: Remember me

TOPIC: [CLOSED] "deleteFile" function in FILE.PHP doesn't work

[CLOSED] "deleteFile" function in FILE.PHP doesn't work 26 Jun 2012 13:06 #2682

  • Tomaselli
  • Tomaselli's Avatar
  • Offline
  • Elite Member
  • Posts: 293
  • Thank you received: 87
  • Karma: 46
the function doesn't work. it doesn't delete the files.
Last Edit: 25 Jul 2012 20:39 by admin.
The administrator has disabled public write access.

Re: "deleteFile" function in FILE.PHP doesn't work 26 Jun 2012 13:14 #2683

  • Tomaselli
  • Tomaselli's Avatar
  • Offline
  • Elite Member
  • Posts: 293
  • Thank you received: 87
  • Karma: 46
I found out. it's due to the filepath parsing.
The administrator has disabled public write access.

Re: "deleteFile" function in FILE.PHP doesn't work 26 Jun 2012 15:02 #2684

  • Tomaselli
  • Tomaselli's Avatar
  • Offline
  • Elite Member
  • Posts: 293
  • Thank you received: 87
  • Karma: 46
the problem is not even that.
it seems there is some kind of conflict in the JFile/JCOOKFile class.
even using the unlink() function directly with the file (but using it inside the class) the file will not be deleted.

if I use the unlink() function directly in the jmodel.item.php (bypassing the switch "delete, trash, thumbs") it perfectly works.
The administrator has disabled public write access.
The following user(s) said Thank You: admin

Re: "deleteFile" function in FILE.PHP doesn't work 25 Jul 2012 18:43 #2889

  • admin
  • admin's Avatar
  • Online
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 985
  • Karma: 140
I had a look, and I can't find the issue.
It is working for me.

If you want to delete the file, you must select 'delete'

When choosing 'remove (unlink)', it only erase the link of the image, and leave the file. This is the normal behavior.
Is it correct for you or do you have an issue using 'Delete' ?
Coding is now a piece of cake
The administrator has disabled public write access.

Re: "deleteFile" function in FILE.PHP doesn't work 25 Jul 2012 18:53 #2890

  • Tomaselli
  • Tomaselli's Avatar
  • Offline
  • Elite Member
  • Posts: 293
  • Thank you received: 87
  • Karma: 46
I don't remember now, I have to take a look again on the code where it didn't work.I'll do on the next days I guess.
by the way, I'm talking about the php unlink() function.
The administrator has disabled public write access.

Re: "deleteFile" function in FILE.PHP doesn't work 25 Jul 2012 19:46 #2891

  • admin
  • admin's Avatar
  • Online
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 985
  • Karma: 140
Are you running under Windows, Mac OSX, or Unix ?

The component do not call unlink php function.
It uses the Jooma Framework, through JFile Class.

... but it is the same.

Tell me when you have more informations.
Coding is now a piece of cake
The administrator has disabled public write access.
Time to create page: 0.077 seconds

Get Started