• Hello Fabrik Community

    Fabrik is now in the hands of the development team that brought you Fabrik for Joomla 4. We have recently transitioned the Fabrik site over to a new server and are busy trying to clean it up. We have upgraded the site to Joomla 4 and are running the latest version of Fabrik 4. We have also upgraded the Xenforo forum software to the latest version. Many of the widgets you might have been used to on the forum are no longer operational, many abandoned by the developers. We hope to bring back some of the important ones as we have time.

    Exciting times to be sure.

    The Fabrik 4.0 Official release is now available. In addition, the Fabrik codebase is now available in a public repository. See the notices about these in the announcements section

    We wish to shout out a very big Thank You to all of you who have made donations. They have really helped. But we can always use more...wink..wink..

    Also a big Thank You to those of you who have been assisting others in the forum. This takes a very big burden off of us as we work on bugs, the website and the future of Fabrik.

Export attachments easily

Status
Not open for further replies.

georgie

Member
Hi

I am a little annoyed...

In a list, I have 3 fields fileupload (3 pdf, obfuscated and secure). Users autorized can download them in form view or detail, OK.
I want ease the 3 exports (just in one export ; or by email ; or by a new button on form or list...).

So I have tested an email form plugin, or a download list plugin, with many kinds of code, without succeed...
I have tested with another fileupload, a simply jpg file, not secure, but same result.

Indeed, email form plugin gives me a file, but empty or corrupted, and download list plugin do not load any download.

:(

Can you help me ?
 
Trying to understand: you want (as one possibility) a button in list view where the user can download all 3 PDFs with one click in a zip-file?
 
There isn't currently a plugin which would do exactly what you want. The list download plugin can zip up multiple files, but it is designed to do so for the same element in multiple rows, whereas you need multiple elements one (or more) row(s).

Here's a screencast of the download list plugin working, downloading an image from two rows in a list:

http://screencast.com/t/PrD3m21PqMH

I'm going to have a quick look at enhancing that ...

-- hugh
 
Hi

Thank you for the commit, I have done.

But I think I have another problem, before this, because I can not load any upload, this for one or many element.

Indeed, when I click on the button list, the page runs, but no download (no error neither).

Please note that I have not the version library GD 2.1.1 ; I have the 2.1.0. Is it a problem ? How can I do this update ?
 
Not quite sure what you mean. Are you talking about the download list plugin?

Nope, GD version wouldn't affect it, as all that's used for is scaling images if you select that option (so the plugin will reduce image size before zipping).

Have a look in either Firebug or Chrome's devtools, look at the Network tab. You should see the download request fire off. Open that up and see if there are any errors or warnings in the response.

-- hugh
 
Hi, yes, thanks, I have now an error message, like "ZipArchive open error:", but without detail.

It is an hint ?
 
Try this. Edit plugins/fabrik_list/download/download.php, around line 186 where it does the $zip->open, change OVERWITE to CREATE.

According to some comments on the PHP site, the behaviour of that function is different in some versions of PHP.


Sent from my HTC One using Tapatalk
 
Hi, I have done, but no change.

Note that when I put a false element in list plugin option (like dxxxfgh___dfgxxx), I have another error message : "No files to ZIP!".

Always "ZipArchive open error:" (with a true element), after changing for "CREATE".

Like the plugin found the file, but was not able to load them...
 
No, the "open error" is saying it can't create the temporary file it is zipping everything in to.

I've added that filename to the error message ...

https://github.com/Fabrik/fabrik/commit/473193ce3753a8a2888ad1e4c3075067932538a5

Try updating, and see what file it is trying to create, and make sure that folder is writeable by your web server. I'm using PHP's sys_get_temp_dir() to get the main system tmp dir, so on UN*X it would typically be /tmp, on Windows it would be something like C:\Windows\Temp. And from reading the comments on php.net ...

http://php.net/manual/en/function.sys-get-temp-dir.php#97044

... it's possible your server may be configured such that we can't write to that.

So ... what you could try doing is using J!'s tmp folder instead. So around line 181, where we currently do ...

PHP:
            $zipfile = tempnam(sys_get_temp_dir(), "zip");

... try this ...

PHP:
            $config = JFactory::getConfig();
            $zipfile = tempnam($config->get('tmp_path'), "zip");

Obviously make sure your ./tmp in the J! root is writeable by the web server.

-- hugh
 
Hey ! Indeed, it is better !!!

After adding filename to the error message, from the commit, I had just a "::" more in my error message.

But, after replacing $zipfile by :

Code:
          $config = JFactory::getConfig();
          $zipfile = tempnam($config->get('tmp_path'), "zip");

Then, I can download one or many files in a zip ! Thanks !!! ;)

Even if I do not understand exactly what does my Joomla temporary directory, a transfer folder? Files transit in tmp to become a zip, and then are deleted ?

Well, big thanks !

I have another question related to this function : I would, always to ease the export of a record and his fileuploads, allows the export of the zip in the form.
Goal : a user can print the record, and in the same interface, export his attachments in a zip.

Do you prefer I open a new topic ?

Thanks again !
 
Hmm sounds like your PHP isn't even setting a system tmp folder. Oh well.

The j! tmp folder is just that - a tmp folder for use by any J! code that needs to use it. And yes, this plugin creates the ZIP in your tmp folder, then deletes it when the download is finished, or if there are any (catchable) errors between creating and downloading it. You may find that some of the temp files don't get deleted - not just these ones, but others than J! and 3rd party extensions create - so you should occasionally check that folder and manually delete any junk piling up in it.

With regards to downloading a ZIP from the form, there is currently no plugin to do that.

-- hugh
 
OK, thanks for details !

Another way to do what I want (ease the export of a record and his attachments), will be to allow the export of the record (in PDF, like a print) in the list.
Like the button to export attachments, I talk about another button.

What do you think about ?
 
So basically you want to be able to do the same as the PDF button on the detail view, straight from the list?

-- hugh
 
You could just change the default detail link so it does that ... in List settings, links, Custom Detail Link, just add format=pdf to the normal detail link ...

Code:
/joomla30/index.php/main-test/details/1/{rowid}?format=pdf

... which works on one of my test lists ...

http://screencast.com/t/LqZAROCipucQ

-- hugh
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top