File Genie PHP Support Product Page

Check if folder exists

Shared 13 years ago
1
likes this idea
13 years ago Denis Hoffmann posted:
Hi,

it would be cool, if "file genie PHP" checks itself if the folder exists or not.

right now I have to put an IF file_exists statment around it.

Cheers,
denis

Replies

Replied 13 years ago
13 years ago Vulcho Vulev replied:
Hello Denis.

Your idea will be discussed with our developers.
Thank you for sharing your need with us.

Regards: Vulcho.
Replied 13 years ago
13 years ago Denis Hoffmann replied:
any news when it will be fixed?
Cheers
Denis
Replied 13 years ago
13 years ago Denis Hoffmann replied:
any news here?
Replied 13 years ago
13 years ago Teodor Kuduschiev replied:
Hi Denis,

Can you please explain why would you need to use File Genie PHP with non-existing folders?
Replied 13 years ago
13 years ago Denis Hoffmann replied:
sure,

the users have the choice to upload images in the backend.
and if they dont there will be no folder.
and in the frontend there will be an error cause there is no image.

cheers,
denis
Replied 13 years ago
13 years ago Teodor Kuduschiev replied:
I see,
Unfortunately this is not possible right now, as you have to select an existing folder in the UI of the extension.

We will discuss the possibilities of adding an if statement into the incFileGenie.php file in any of the future versions.
Replied 12 years ago
12 years ago Willy Gelin replied:
Dennis ore someone else would you be kind and explain how you did this "IF file_exists statment" coding and where.

I'm uploading files with DmxMulti uploader and inserting them in dynamic folders with Upload folder set to
"filesUpload/".$HTTP_SESSION_VARS['user_login']


Now I want to list the files with File Genie in lets say filesUpload/123456-789/ that was created at upload if there are any such folder created.
This reply was removed on 11/23/2012 9:31:10 AM.
See the changelog
Replied 12 years ago
12 years ago Willy Gelin replied:
This is what i did, I upload files in dynamic folders as shown in previous post
"filesUpload/".$HTTP_SESSION_VARS['user_login']  


Then in incFileGenie.php about line 110 I add
if (is_dir($this->path))

to check if there is any folder with the specific path. Like this:
		// Get all files
		
		if (is_dir($this->path)) { //mod by Willy
			
		$handle = opendir($this->path);
		while (false !== ($file = readdir($handle))) {
			if (is_file($this->path."/".$file)) {
				$name = $file;





And then around line 203 a closing bracket like this
			}
		}
	}
	} //mod by Willy
	function getRealNameFromThumbnail($file) {
		$name = $file;
		$extension = "";
		$pos = strrpos($file, ".");



If it helps anyone

Reply to this topic