1

I made an app, and when it was tested, the tester made a file named: "Joe'sTestPage". Which amounted into: "Joes\'TestPage.htm". M problem is that the file is undeletable because of the slash in the name. I have tried using my ftp in my cpanel, but that cant delete it either.

Does anyone know of a solution?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Tanner Ottinger
  • 2,970
  • 4
  • 22
  • 28

2 Answers2

5

You should be able to delete it from within PHP. If necessary, double escape the backslash:

unlink("Joes\\'TestPage.htm");
Pekka
  • 442,112
  • 142
  • 972
  • 1,088
1

Make sure you're escaping the backslash when you delete

Alternatively...

I assume you do not have SSH access to the server. If you did, you could let your shell auto-complete the filename. If you cannot resolve the issue, email your host/datacenter (It sounds like you're in a shared hosting environment) and have them remove the file.

Craige
  • 2,882
  • 2
  • 20
  • 28