Maximum Files in FileSet - RESOLVED

Permalink Browser Info Environment
Hi John
It would be a useful addition to have a limit to the total number of files that can be added to the File Set, i.e. Have an error message appear when the maximum has been reached,
This would force the clients to do a little house keeping instead of using the server as a dumping ground for images that are not being used.
Is this even possible?

Type: Discussion
Status: Archived
ConcreteOwl
View Replies:
JohntheFish replied on at Permalink Reply
JohntheFish
Hi Dave

The core of concrete5 provides no way to actually limit the size of a fileset.

I have an addon currently in the PRB, Front End Fileset Tools, that integrates with FEFU to provide a complete on-page solution to managing a fileset when the 2 blocks are used together. One of the options in FEFT is to limit the fileset size, delete those over the size and block FEFU when the size is reached.
http://www.concrete5.org/marketplace/addons/front-end-fileset-tools...

Its not a perfect solution because there is still a transient overflow. If the limit is set to 10 files and someone uploads 100 files in one go, they could all get uploaded, but 90 of them get immediately deleted.

As to when it is available, the PRB is in limbo at the moment, sort of ticking over but with no clear end, as a result of
http://www.concrete5.org/developers/pro-accounts/community-leaders-...

In the mean time, if you want to buy a copy privately I can send you a zip and then assign you an official licence when it is available. The marketplace price will be $30, so if you PayPal me £20 with a note that you want FEFT that will cover it.

John
ConcreteOwl replied on at Permalink Reply
ConcreteOwl
Hi John
I did reply to the email from concrete but I suspect you have not received it?
How do I PayPal you?
Can you send me a PayPal invoice??
ConcreteOwl replied on at Permalink Reply
ConcreteOwl
*Quote*
Its not a perfect solution because there is still a transient overflow. If the limit is set to 10 files and someone uploads 100 files in one go, they could all get uploaded, but 90 of them get immediately deleted.
*Unquote*

If the option to allow multiple uploads is set to "off" (default setting) in FEFU then this situation would not arise, Or have I got that wrong?
JohntheFish replied on at Permalink Reply
JohntheFish
Multiple uploads in FEFU allows a bunch of uploads to be queued up and then all uploaded in one go, which is not the same as making a bunch of uploads sequentially, but still in the FEFU popup.

Especially in the drag/drop uploader, a user can drag a whole group of files into the uploader. These are uploaded sequentially one after the other.

At the same time, FEFT is notified of each upload, but because of the delays of the ajax transactions to check the fileset, the uploads can get ahead of the deletions to go over the fileset size limit until everything catches up, or until FEFT sends FEFU a message to stop and hide from the user so they cant do any more. How far ahead depends very much on the client browser and also on the server response speed to ajax requests.

At the end of it all, the fileset will be reduced to its size limit. But in the mean time there could be a few extra files, especially if a user goes manic. You can have fun testing that :)
ConcreteOwl replied on at Permalink Reply
ConcreteOwl
A few points..
On FEFU I can't get the Cancel Button showing? I never looked for it before, maybe its me..
Having played with FEFT for a while, I think it is almost exactly what is required to control the numbers of file that clients upload to a given file set,
What (for my application) would make it even better would be the ability to auto close the FEFU dialogue box when "Upload" has completed instead of leaving it open and giving the client the ability to add more files for uploading, I only want the clients to upload files one at a time anyway.
This would avoid the inevitable confusion when they have added (for example) 25 files, and only 5 are showing in the file set because they have reached the maximum allowed..
Any thoughts on the above John.

EDIT
I should have mentioned, an observation that FEFT appears to be only able to delete files that are uploaded to the file set by FEFU, If I add some extra through concrete file manager, they are not removed by FEFT even though they are in excess of the maximum allowed..
JohntheFish replied on at Permalink Reply
JohntheFish
To show a cancel button in the uploader is now an option in the FEFU edit dialog (assuming your copy is up to date).

I will think about whether it is practical to auto-close FEFU whenever FEFT detects an upload, or adding an option to FEFU for one-at-a time uploads. It may not be as easy to do this reliably as it at first seems. There are hidden complications in the way drag/drop interacts.

On the file deletion, FEFT checks the fileset when it is changed by FEFT or by FEFU on the same page. So it should catch up with deleting the excess files added to the set through the file manager next time you use FEFT. Please let me know if it is not doing that.
JohntheFish replied on at Permalink Reply
JohntheFish
FEFT has an option to auto-close the uploader when it detects the fileset is full. This is where there could be the excess that gets deleted I mentioned because it takes time for FEFT to find out that the set is full and close FEFU.
ConcreteOwl replied on at Permalink Reply
ConcreteOwl
The version of FEFU is 2.2 and I have ticked the "Show a Cancel button in dialog" but I don't see it..

It would be excellent if FEFT could delete files added by file manager, but I am sorry to report it isn't doing that at the moment,
To test this I set the maximum files to "5" and added 5 files via FEFU after which FEFU was hidden..
I then added 3 more via the file manager and went back to the page to find 8 in total, i tried refreshing the browser but the 8 images persisted.
I am using a Wamp local server, would that make a difference?
JohntheFish replied on at Permalink Reply
JohntheFish
The missing cancel button in FEFU is definitely a bug since the last update so I need to fix it.

I just experimented with FEFT and can duplicate the behaviour you report. That wasn't my intention when developing the block, it should have caught up next time it was used, so I will see if I can resolve that.

While I am inside both of the addons looking at these glitches, I will also have a look in more detail at the single upload and then close behaviour you suggested.

You can expect an update to FEFU some time in the next few days and I will email a revised zip for FEFT.
ConcreteOwl replied on at Permalink Reply
ConcreteOwl
Brilliant..
Thanks John.
ConcreteOwl replied on at Permalink Reply
ConcreteOwl
John
Whilst you are in FEFU can you look at the templates, because when I open the template dialogue, I see two of each template,
The templates folder has 7 folders and 7 php files of the same name, Example - 1 folder called discrete_icon and 1 php file called discrete_icon, If I drop the php files into there corresponding folders (with the existing view.php files) The duplication appears to be fixed..
Just thought I would mention it..
JohntheFish replied on at Permalink Reply
JohntheFish
Yes, that is definitely a mistake made by me copying a new version into an old directory. I changed the way templates work to directories rather than file names, warned about it in the update, then with that copying mistake left the old files in :(.

Must have been having a bad day with that.
JohntheFish replied on at Permalink Reply
JohntheFish
I have just uploaded v2.2.0.1 with the duplicate templates removed (and that is the only change). The close button fix will be in the next update when I have time to investigate fully.

>>>>
v2.2.0.1 Fix duplicate template name bug. Users may have to edit FEFU blocks and re-select a template after this upgrade if using any template other than the default.
>>>>
JohntheFish replied on at Permalink Reply
JohntheFish
Dave

v2.2.0.2 fixes the close button option and adds a close after upload option.
ConcreteOwl replied on at Permalink Reply
ConcreteOwl
Thanks John
I will try the updated FEFU,
Just the FEFT fix required and we should be all good to go..
Thanks Again
Dave
ConcreteOwl replied on at Permalink Reply
ConcreteOwl
Very happy to report Front End File Tools (FEFT) version 0.9.6 works perfectly for me now John,
Excellent!
Thank You..
JohntheFish replied on at Permalink Reply
JohntheFish
When you have a few minutes to spare, perhaps you can write some nice reviews - they always help.

(May have to wait a while for FEFT to be released, the PRB is in limbo at the moment).

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.