Anything happening on this? Thx
So it works with one way of adding files, but not the other. That’s still 50% not working. I created a patch that seems to work for me with http attachments. Could you check it out and consider adding to the plugin?
Index: src/Package/FileList.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/Package/FileList.php b/src/Package/FileList.php
--- a/src/Package/FileList.php
+++ b/src/Package/FileList.php (date 1627659974653)
@@ -222,7 +222,8 @@
$classes = array('1' ► 'col-md-12', '2' ► 'col-md-6', '3' ► 'col-md-4', '4' ► 'col-md-3', '6' ► 'col-md-2');
$class = isset($classes[$cols]) ? $classes[$cols] : 'col-md-4';
- foreach ($allfiles as $fileID ► $sfile) {
+ foreach ($allfiles as $fileID ► $sfile1) {
+ $sfile = wpdm_is_url($sfile1) ? get_attached_file($fileID) : $sfile1; // for files added as https get file from the FID
$fhtml .= "<div class='{$class} col-sm-6 col-xs-6'><div class='panel panel-default card mb-4'>";
$ind = $fileID; //\WPDM_Crypt::Encrypt($sfile);
The download button worked now, thanks.
Thanks but tags only help if the underlying php code works.
e.g. file size won’t work if file_size() function fails – which it does for the reason stated above.
Did you change the package definition structure from paths to URLs, or is there something strange about our site?
It seems be caused by files being passed as URLs to php functions that expect paths e.g. file_size(), file_exists().
Bump! (As I said it’s not working on the staging site.)
Thanks. So why is it still saying 0.00?
Oh… Is package size not automatically calculated?
Thanks, but my problem hasn’t been resolved, I’ve just made a workaround. Please would you help with a proper fix?
I’ve patched it
`Index: src/__/FileSystem.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff –git a/src/__/FileSystem.php b/src/__/FileSystem.php
— a/src/__/FileSystem.php (date 1626349466779)
+++ b/src/__/FileSystem.php (date 1626349466779)
@@ -260,8 +260,8 @@
if ($zip->open($zipped, \ZIPARCHIVE::CREATE) !== TRUE) {
return false;
}
– foreach ($files as $file) {
– $file = trim($file);
+ foreach ($files as $fid ► $file) {
+ $file = get_attached_file($fid);
$filename = wp_basename($file);
$file = WPDM()->fileSystem->absPath($file);
/*if (file_exists(UPLOAD_DIR . $file)) {
I can see code in FileSystem::zipFiles() that’s passing URLs of files to ZipArchive::addFile(), but I think it expects a file path? The result is each addFile fails and the created zip is empty.
To clarify:
If I click “Download” on individual files it works.
If I click “Download” button for the package I download a 0-length zip.
I’m also having trouble with this update. Is it possible to update the plugin in place, or do I need to download the zip from your site and upload manually?
U was a bit slow to understand there. but it fixed it.
This is what I did:
1 Go to “Downloads” + “Settings” in admin menu
2 Click “License” tab on left.
3 Click “Save settings”
Thanks!
More or less… My requirements are: exclude/prevent the count of downloading the packages BY my staff from the download-stats
Let me explain the problem again.
The good bit: I can see the download stats, e.g. who is downloading, which downloads are most popular etc.
No problem there.
However the stats are misleading; I am only interested in downloads done by customers, but the stats also include downloads done by our staff. If a member of staff (with role editor) downloads a document from the website I do not want that increment the download count for that document.
Does that make sense?
Your questions dinner make sense. I honestly don’t know if you have understand my question!