Jump to content

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...

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.