Giter Club home page Giter Club logo

filelister's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

filelister's Issues

No longer loading files

After recent server upgrades, a site with FileLister stopped displaying the file. It is now only linking back to the listing page without any file reference.

FR: Recursive files listing over subdirectories

When changing the lines

/** @var DirectoryIterator $file */
foreach (new DirectoryIterator($curPath) as $file) {

with

/** @var DirectoryIterator $file */
$di = new RecursiveDirectoryIterator($path);
foreach (new RecursiveIteratorIterator($di) as $filename => $file) {

FileLister iterates recursivly into the subdirectories of a given path.

Changed
$filePath = $relPath.(!empty($relPath) ? '/' :
with
$filePath = str_replace($path, '', $filePath);

and the download links working.

I'm not a developer and I think this is a hack without knowing if I produced a security risk or other issues with that change...

Would be great if this functionality is integrated into FileLister.

Thanks.

No output in MODX 2.3

FileLister doesn't generate any output in modx 2.3.

*** UPDATE ***
Sorry, my bad. Did not use a relative path. Started with a / in the filepath. When removing the slash the path is relative and works

php implode() error

I get the following error with using filelister (has ID 26 on my site):

[2010-08-15 11:23:03](ERROR @ /home/public_html/core/cache/elements/modsnippet/26.include.cache.php : 248) PHP warning: implode() [function.implode]: Invalid arguments passed

I checked my setup of filelister but couldn't find any error.

How I call FileLister:
[[!FileLister?
&path=assets/media/[[*id]]/
&fileTpl=listIMG
&showExt=jpg,gif,png
&showDirectories=0
]]

listIMG Chunk just outputs an IMG-Element with use of the placeholder [[+path]]

On a Windows system, the download count is zero, because of backslash in path.

The path field in the db contains assets/downloads/file.ext, but $file->getPathname() in snippet.filelister.php returns assets/downloads\file.ext on Windows systems (with a backslash). So $modx->getCount('feoDownload',$w) (line 188) returns zero, because it doesn't find the path in the db.

I fixed it by changing line 160 to $fileArray['path'] = str_replace('\\', '/', $file->getPathname());. Perhaps it should be solved in an other way, but this was the simplest solution for me.

How to cache FileLister output?

I need to cache file listings generated by FileLister. In most cases I use getPage, which offers caching, but I can't manage to cache totalVar value. I put snippet output to a placeholder with toPlaceholder. I tried getCache too but with the same result.

How should it be made the proper way?

Hide/replace root path string in generated placeholder [[+filelister.path]] link

Hi,
Really good snippet ;)
One feature request: it would be great to be able to hide or replace root path string with a custom one, like 'home'.
Currently [[+filelister.path]] placeholder is returning the root path string ,ie 'assets/.../...', so it shows where the files are located; it would be nice to start with a custom string like 'home' or 'root',

Thanks,
Kevin

File downloads get truncated at 70mb

Hi, I'm having an issue with attempting to download large files - anything over 70mb is being truncated. I'm running modx on a shared server where the PHP memory limit is 80mb - could this be an issue? I don't need the security of a hash - is there any way the plugin could return the actual path of the file, as I'm guessing this might resolve the issue?

Thanks,
Dave Vernon

Additional variable check

Looks like one more condition needed, because sometimes apache writes error.log with
PHP Notice: Undefined variable: scriptProperties in .../core/components/filelister/model/filelister/filelister.class.php on line 124

Geolocation - still not working?

I've tried setting filelister.ipinfodb_api_key at the context, system, snippet level, no joy.
All I ever get in the database for the geolocation info (country, zip etc) is the default blank values.

Can you confirm it works for you?

Geolocation - ipinfodb now requires API key

Shaun - all geolocation entries in modx_filelister_downloads are showing : {"Ip":"0.0.0.0","Status":"MOVED","CountryCode":"","CountryName":"","RegionCode":"","RegionName":"","City":"","ZipPostalCode":"","Latitude":"0","Longitude":"0","Timezone":"0","Gmtoffset":"0","Dstoffset":"0"}

Presumably because they've moved server to api.ipinfodb.com, added a $version and need for a key. New class here: http://mirrors.ipinfodb.com/ipinfodb/classes/geolocationapi_class.zip
(not skilled enough to fork and update myself, sorry).

requireAuthDownload not working properly

I am using requireAuthDownload=1 and allowDownloadGroups=mygroup in a filelister call which is working correctly in that it is making the file a link when I am logged in and just text when not logged in. The problem is when I click on the file to download it all it does is just refresh the page and doesn't download the file?

authenticated downloads

check download access is not working like it should. if i anyhow get a download link for a file and not logged in as a user/manager i could nevertheless download the file. reordering some of your code fixes this problem for me

/* check download access */
$allowDownloadGroups = $modx->getOption('allowDownloadGroups',$scriptProperties,'');
if (!empty($allowDownloadGroups)) $allowDownloadGroups = explode(',',$allowDownloadGroups);

$canDownload = $modx->getOption('allowDownload',$scriptProperties,true);
if ($modx->getOption('requireAuthDownload',$scriptProperties,false)) {
    $requireAuthContext = $modx->getOption('requireAuthContext',$scriptProperties,$modx->context->get('key'));
    $canDownload = $modx->user->hasSessionContext($requireAuthContext);
}
if (!empty($allowDownloadGroups)) {
    $canDownload = $modx->user->isMember($allowDownloadGroups);
}
unset($requireAuthContext,$allowDownloadGroups);

/* if pointing to file, output file */
if (!is_dir($curPath) && is_file($curPath) && $canDownload) {

Geolocation - no geo lookup data written to database

Apologies - closed #8 by mistake:

I've tried setting filelister.ipinfodb_api_key at the context, system, snippet level, no joy.
All I ever get in the database for the geolocation info (country, zip etc) is the default blank values.

I've manually replaced the URL in ipinfodb.class.php to a known working url that returns an XML file, but I cannot get the script to enter the loop in lines 100-110 of snippet.filelister.php - presumably because the array is empty. Also, a $geolocation array is created on line 99 that doesn't seem to do anything.

&showDirectories=`0` doesn't work

It still shows directories. The call I'm using is
[[!FileLister? &path=assets/member/ &allowDownloadGroups=Members &requireAuthDownload=1 showDirectories=0]]

FR: Add getPage support

Having a param for limit of files per page and adding navigation links (pagination) or a tutorial of how to get it working with getpage

Target a single file

Would love to be able to target an individual file within a directory if required.

Possibly by using some new new property called &doc=``

[[!FileLister? &path=/docs/marketing/ &doc=my-document.doc &allowDownloadGroups=Marketing,CEO]]

Would be useful where I need to protect docments from inputting an absolute URL in a browser window.

Can't download if Referer Empty

Line 96 of the snippet is

$dl->set('referer',$_SERVER['HTTP_REFERER']);

However, some user agents can leave that field empty, which prevents downloading. It needs a fallback for when their's no referrer.

FR: Add alternating row classes

would be keen on having the row td (class) indicate odd or even for displaying alternate rows with different background colour.

UPPERCASE File extension

# @186 string FileLister snippet
$fileArray['extension'] = strtolower(pathinfo($fileArray['path'],PATHINFO_EXTENSION));

# @234 string feoheaders.class.php
$extension = strtolower(pathinfo($file,PATHINFO_EXTENSION));

Docx mime types

docx files attempt to download as a zipped folder in IE8.

I realise this is only a minor issue and easy to fix, add 'docx' => 'application/msword' to the feoheaders file, as well as becoming quickly irrelevant but I just thought I'd raise it. I was baffled for a while thinking my mime types were not set correctly on my server!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.