File Genie PHP Support Product Page

Check if folder exists

Shared 06 Mar 2012 12:27:17
1
likes this idea
06 Mar 2012 12:27:17 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 06 Mar 2012 12:31:43
06 Mar 2012 12:31:43 Vulcho Vulev replied:
Hello Denis.

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

Regards: Vulcho.
Replied 20 Mar 2012 05:36:38
20 Mar 2012 05:36:38 Denis Hoffmann replied:
any news when it will be fixed?
Cheers
Denis
Replied 19 Apr 2012 13:38:12
19 Apr 2012 13:38:12 Denis Hoffmann replied:
any news here?
Replied 20 Apr 2012 06:28:03
20 Apr 2012 06:28:03 Teodor Kuduschiev replied:
Hi Denis,

Can you please explain why would you need to use File Genie PHP with non-existing folders?
Replied 20 Apr 2012 07:03:10
20 Apr 2012 07:03:10 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 20 Apr 2012 07:34:42
20 Apr 2012 07:34:42 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 10 Jun 2012 12:14:57
10 Jun 2012 12:14:57 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 23 Nov 2012 09:41:11
23 Nov 2012 09:41:11 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