Anyone? Is it a regex issue?
Get your own copy
Don't hesitate! Just download and test it all by yourself for free!
Pages 1
Anyone? Is it a regex issue?
I need to allow users to browse three specific folders in a directory.
To do this i set the folder names in include_directory_pattern like so:
include_directory_pattern:"/^mcith$|^folder1$|^folder2$|^folder3$/i"
Which out of the 3 folders they are allowed to browse is dependant on their user level so that piece of javascript is built on the fly.
This works ok BUT the subfolders within these folders do not show up, when i remove the pattern they appear.
How do I show subfolders within the 3 folders?
It is because i have a list of files on a web page build using php recursively going through a directory and listing files by the modified date descending, (it is the most recent 5 uploaded files). I then need a way of allowing users to view all the rest of the files so I allow users to browse the entire folder using filemanager. But they can also change file names, delete files etc so once they make any changes and close the window, It needs to update the list in the original window which happens via an ajax call. It is this bit of js that i need to trigger.
Hope that made sense.
Ah, Ok, changed it to browse.
The problem is that there is no insert action. So oninsert is never triggered. I want to trigger js when the window is closed.
Not sure if that is what i am after. I have this link:
mcFileManager.open("","","","",{include_directory_pattern:"/^mcith$|^folder$/i",rootpath: "../../../files/groups",remove_script_host:true})
By looking at that example, does it need to be?
mcFileManager.open("","","","",{include_directory_pattern:"/^mcith$|^folder$/i",rootpath: "../../../files/groups",remove_script_host:true,oninsert : doOnClose();});
If so, I tried this and it wouldn't call doOnClose().
Also, are the form name and field manadatory? This is to merely browse a file structure, it doesnt need to populate a form field.
When a user has finished browsing files and has closed the filemanager, i need to trigger some javascript.
I cant seem to find any documentation on a callback when the window is closed.
How do i do this?
I am having the same problem, it happens when i create a folder in the root with an uppercase letter, how do i fix this?
Can you explain how to use an mc_access file? I have read around and cant quite piece it together.
What i know so far is that i have to put a mc_access file in every folder below my root folder. The filemanager will then inherit the config params within. If that is correct, what about new folders? created by the user
Great...
My link is now mcFileManager.upload({path : '{0}/content/'});
Which works.
![]()
I need to force uploads into a subdirectory. I read that i need to set the subdir using path.
Like so:
mcFileManager.upload({path : '/content/'});
(This is my entire link, does it need any other params?)
As you can see, the subdirectory is called "content", have i done it correctly?
Does it append the path to a config param?
I have them set to:
$mcFileManagerConfig['filesystem.path'] = 'D:/Inetpub/wwwroot/www/files/'; // absolute or relative from this script path.
$mcFileManagerConfig['filesystem.rootpath'] = 'D:/Inetpub/wwwroot/www/files/'; // absolute or relative from this script path.
I have a directory called "content" in "D:/Inetpub/wwwroot/www/files/" but it wont display the upload form, when i remove the path param it loads the upload form but points to "D:/Inetpub/wwwroot/www/files/".
How do i force it to the subdir?
Aaaaah! Excellent... i think i have everything i need to get started... for anyone else:
function onFileAction(&$man, $action, $file1, $file2) {
echo $file1->getLength(); // echo file size, check LocalFileImpl.php for all methods
return true;
}
when i print_r($file1) i dont get anything other than the path to the file.
Output:
Moxiecode_LocalFileImpl Object
(
[_absPath] => D:/Inetpub/wwwroot/site/files/test.PNG
[_manager] => Moxiecode_ManagerEngine Object
(
[_config] => Array
(
// Removed
)
[_plugins] => Array
(
[core] => Moxiecode_CorePlugin Object
(
)
[filemanager] => Moxiecode_FileManagerPlugin Object
(
)
[history] => Moxiecode_HistoryPlugin Object
(
[_maxhistory] => 10
)
[favorites] => Moxiecode_FavoritesPlugin Object
(
[_maxfavorites] => 10
[_cookieData] =>
)
[convertvideo] => Moxiecode_convertVideoPlugin Object
(
)
[baseauthenticator] => Moxiecode_BaseAuthenticator Object
(
)
)
[_prefixes] => Array
(
[filemanager] => fm
)
[_fileSystems] => Array
(
[file] => Moxiecode_LocalFileImpl
[root] => Moxiecode_RootFileImpl
[zip] => Moxiecode_ZipFileImpl
[history] => Moxiecode_HistoryFile
[favorite] => FavoriteFile
)
[_rootPaths] => Array
(
[0] => D:/Inetpub/wwwroot/site/files
)
[_language] =>
[_type] => fm
[_logger] =>
[_langPackPath] => fm
[_invalidFileMsg] => {#error.invalid_filename}
)
[_config] => Array
(
// Removed
)
[_type] =>
[_events] => 1
[_statCache] => Array
(
[exists] => 1
[is_file] => 1
)
)
Cool.. managed to access the session var.
I have also managed to get the file name, is there any more information available to me beyond that? Or is the path and file name pretty much it... i am asking as i can see the response sent to the client which contains all the information i am after, e.g. file size, type etc.
Great, am starting to get somewhere now.
I need to pass the logged in users id so have looked into the custom data option.
this is my link:
javascript:mcFileManager.browse({oninsert:customInsert,custom_data : "userid_23", extensions:"jpg,jpeg,png,gif"});
How do i access this from onFileAction? The documentation refers to a session var yet when i print_r($_SESSION) i cannot see it.
I need to store details of the file uploaded into a database, that is everything, e.g. file name, size, extension, user uploaded id etc,etc
I know i can do this in a plugin within the onAfterUpload function. The problem is i cant workout how to get hold of the file details... in the example it has $man, $cmd, $input but doing a print_r on all doesnt return any file details. Can you post a simple bit of php which will echo the file name? I can work the rest out from there..
FF2 on XP. It is random, it worked for a few hours then stopped again.
If anyone else needs sample code (untested, but enought to get you started):
<script type="text/javascript">
function customInsert(data) {
console.dir(data); // used in firebug - very useful
jQuery.each(data.files, function(){ // I used jquery, mpdify for your own needs
alert(this.url);
});
}
</script>
And the link to open:
<a href='javascript:mcFileManager.browse({oninsert:customInsert});'>[BROWSE[</a>
I have three filemanagers in one page. When i open one, and then click on "Upload", the upload form doesnt show. It used to but has stopped. Looking at it using firebug i can see the form but its display is set to none.
What could stop it from showing?
Is it possible to specify upload.extensions as part of the link? i have several mcfilemanagers in one page and want to control what users upload.
Figured it, needed to use .browse, not .open.
I am struggling in getting it to work, this is what i have so far:
<a href='javascript:mcFileManager.open("entryform","field_id_22","","",{remove_script_host:true , oninsert:customInsert });'>
<img src='/img/insertfile.gif' border='0' style='margin-left:4px; position:relative; top:5px;' />
</a>
<script type="text/javascript">function customInsert(data) {alert('Focused file: ' + data.focusedFile.url + ", Size: " + data.focusedFile.size);}</script>
I get no js error or alert.
Is what i have done correct?
Great. I assume i need to use a callback.. could you point me in the direction of the wiki page which would help me through this?
I have played with the standalone demo and want to know if its possible to insert more than one file at a time.
From the demo it looks like you can only insert one, which means i would need to open the filemanager for every file i want to insert.
Ideally, it would be good to insert multiple files by selecting them using the checkboxes, is this possible?
Pages 1
You are not logged in. Please login or register.