goldsky / FileDownload-R

FileDownload snippet for MODX revolution
12 stars 7 forks source link

externa media source integration #51

Open brescianicri opened 8 years ago

brescianicri commented 8 years ago

I try to access to drop box media source but doesn't work. You ca write e documentation ? This is my snippest:

[[!FileDownload?
&getDir=`tests/`
&mediaSourceId=`6`
&tplFile=`jsDownload`
&tplWrapper=`jsDownloadwp`
&dateFormat=`d-m-Y`
&sortBy=`date`
&sortOrder=`DESC`
]]

But i recive this error: "Principal 3 does not have permission to load object of class modContext with primary key: mgr" and i don't see anything. In my opinion this parameter "getDir" doesn't need, because in my dropbox app i select the directory.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/34424165-externa-media-source-integration?utm_campaign=plugin&utm_content=tracker%2F1480317&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F1480317&utm_medium=issues&utm_source=github).
brescianicri commented 8 years ago

Maybe i found the problem: in _fileInformation function this instruction: $type = @filetype($fileRealPath); (row 1244)

doesn't work, and return false. This do fail the order function and return nothig.

brescianicri commented 8 years ago

I add at line 1117 this if:

/*check that there is the file type or else I put in file*/
                        if ($fileInfo['type'] === false) {
                            $fileInfo['type'] = 'file';
                        }

and work, a see you script don't take, the correct date of file and 0 with file size. I use this puglin: http://modx.com/extras/package/dropbox

for create the media source.