Please login or register.

Login with username, password and session length
Advanced search  

News:

You need/want an older version of sNews ? Download an older/unsupported version here.

Author Topic: (Sorta Solved) Can't delete an uploaded file with apostrophe in file-name  (Read 5196 times)

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6020
  • Semantically Challenged
    • snews.ca

This is a strange problem that I've not come across before. I did a simple site for my old band-mates a while back using a "pages only" version of 1.6. They didn't do anything with it for some time until a few days ago. One of them - Jim - decided to finally upload a batch of MP3 files from their recent CD. When you visit the domain... you'll see the list of tracks (shortened clips) in the left side-bar box. It's auto-generated by a small function that detects and shows the file-names in the resident folder

Jim named had named one of the files as - I Can't Say ( Short Version) - and you'll see that text-link at the top of the list... with a backslash before the apostrophe. It doesn't load and play while the others do. For some reason, using an apostrophe in the file-name... then uploading it to the server using the sNews 1.6 File Upload Panel... causes the back-slash to be inserted into the file-name. (will have to find a cure for this).

Now... with the file-name in this form... the file appears to have been corrupted or screwed somehow.
- I tried re-naming it on the server but it won't change... just reverts back to what it was.
- When I tried downloading it to my machine... it generates a folder first named I Can and places an empty file (0 bytes) inside it named 't Say.mp3
- I tried deleting the file from the server - won't let me do that either.

Has anyone else ever come across this? How does one delete such a file?  ???
« Last Edit: November 12, 2008, 03:16:39 am by Keyrocks »
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

Joost

  • Guest
Re: Can't delete an uploaded file with apostrophe in file-name
« Reply #1 on: November 11, 2008, 11:03:04 pm »

Files can be deleted  using unlink
Upload a file with the following code to the same folder (or find and use the full pathname):

Code: [Select]
<?php
unlink
("file\'name.mp3f"); # use double quote marks
?>

Probably  magic quotes is switched on (check phpinfo() ).

To shut it down, insert the following in .htaccess:
php_flag magic_quotes_gpc off
Logged

funlw65

  • Hero Member
  • *****
  • Karma: 96
  • Posts: 771
    • Country Lab
Re: Can't delete an uploaded file with apostrophe in file-name
« Reply #2 on: November 11, 2008, 11:14:59 pm »

Long time I fought with windoze people about file names with space inside.... bad habit ...
The World Network is ruled by Unix and command line. The majority of network servers come without a graphical interface. The "Artistic" title of a  .mp3 musical piece must be inside  

See here, I found something interesting: http://musicplayer.sourceforge.net/
Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6020
  • Semantically Challenged
    • snews.ca
Re: Can't delete an uploaded file with apostrophe in file-name
« Reply #3 on: November 12, 2008, 01:57:06 am »

Thanks for the info. After posting above... I did some digging on 550 Prohibited file name which is the status message Filezilla shows after executing the delete command. The reason it is not deletable... according to what I've read so far... is (of course) because my access privileges don't allow me to delete it. The suggestions are to contact the host techie and have him delete it. Some hosts who have not had experience with this usually take the route of quarantine-ing the file by moving it into 'dump' directory and leaving it there.

I did come across the unlink as well... uploaded it to the folder and pointed the browser to it... all I get is a 404 and the file is still there.

I also came across the suggestion to simply move all the good files out of the parent folder... re-name it to something abstract - like 'garbagecan'... make a new media folder and move the good files back into it.

Will do some more reading...

The majority of network servers come without a graphical interface. The "Artistic" title of a  .mp3 musical piece must be inside 
See here, I found something interesting: http://musicplayer.sourceforge.net/

Yes. I know about adding the tags 'inside' the files and had given Jim a note about that... he seems to have forgotten.
I had previously installed a modified version of MP3 Web Player 1.6 that opened a popup when you clicked an image of the actual CD in the side-bar. It OK but they wanted something really simple so I whipped up the directory-reading function for them today... which is when I discovered the screwy file issue.
« Last Edit: November 12, 2008, 02:10:21 am by Keyrocks »
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

Joost

  • Guest
Re: Can't delete an uploaded file with apostrophe in file-name
« Reply #4 on: November 12, 2008, 02:03:26 am »

Your not getting a 404 from a script. You getting a 404 from apache.
Either you point to the wrong file, or this directory is somehow protected ( .htaccess)
Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6020
  • Semantically Challenged
    • snews.ca
Re: Can't delete an uploaded file with apostrophe in file-name
« Reply #5 on: November 12, 2008, 02:13:21 am »

1 - Your not getting a 404 from a script. You getting a 404 from apache.
2 - Either you point to the wrong file, or this directory is somehow protected ( .htaccess)

1 - That much I do know.  ;)
2 - There is only one file and the directory is not protected by any .htaccess. There's only the sNews .htaccess in the domain root.
I shall try some more.

Ahhh... to h*ll with it. It was a whole lot easier to move the good files out of the folder... rename the folder as "garbage" and move the good files back into a fresh folder. Done. Solved. G'night.  ;)
« Last Edit: November 12, 2008, 03:15:09 am by Keyrocks »
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU