Jump to content

A folder with a space...


arbitter

Recommended Posts

Hello,

 

I would like to make folders with a space in it (in DirectAdmin).

Now the problem is when I do this, I can't do anything with the file, can't reset the owner, can't rename it, can't delete it, can't put somthing in it, ...

Managed to delete them via an FTP client.

 

Why do I want this?

http://www.fransdepypere.be/uploads/uploads.php

Here you can see on the left hand months with according years. It's put together like this:

$dirs = glob('*',GLOB_ONLYDIR|GLOB_NOSORT);
				foreach($dirs as $dir) {
					$sortedDirs[filemtime($dir)] = $dir;
				}

foreach (($sortedDirs) as $map)
					{	$qmap = urlencode($map);
						if(isset($_SESSION['sort'])){
							echo "<tr><td colspan='2' bgcolor='white' width='200' align='center' valign='middle' style='cursor:pointer' onclick=\"location.href='?month=$qmap&sort&#61;$sort'\"><center>$map</center></td></tr>";}
						else{echo "<tr><td colspan='2' bgcolor='white' width='200' align='center' valign='middle' style='cursor:pointer' onclick=\"location.href='?month=$qmap&sort&#61;ksort'\"><center>$map</center></td></tr>";}
					}

 

Is there a simple solution to this?

 

edit: You don't need to look at the sorting types

Link to comment
https://forums.phpfreaks.com/topic/196367-a-folder-with-a-space/
Share on other sites

If you are using a Linux OS for your server you will need to encase the directory in single quotes if it has a space in it. On windows, I believe you would have to encase the whole path in single quotes.

 

But I do not see in that code where you are trying to delete / chown / chmod the directory?

 

On another note, why not just replace the spaces with _ or -, as this will be much easier to manage and not require extra / special code to manipulate. 

Well I want a space between the month and the year. The folder on the server, in DirectAdmin, is the same name as the month and year.

 

I don't want to put a underscore or - because that isn't that pretty, seems to me. It isn't prety like this eather, but it's better than nothing I guess.

 

How do you mean that you can't see where I'm trying to delete the directory? What should I show? It was in DirectAdmin that I had problems with filenames with a space in it. I can't put any ' 's in the name of the folders...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.