Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit number of Files Uploaded #516

Closed
designlab9898 opened this issue Aug 18, 2015 · 40 comments · Fixed by #1723
Closed

Limit number of Files Uploaded #516

designlab9898 opened this issue Aug 18, 2015 · 40 comments · Fixed by #1723

Comments

@designlab9898
Copy link

Is there any option to limit the number of files that are allowed to be uploaded depends on the Job Package?

@blue928
Copy link

blue928 commented Aug 18, 2015

I can't see it if it's available, but I believe this would be a great enhancement.

Currently I'm altering my $fields (Logo) array to contain 'ajax' => 'true', 'multiple' => 'true'. It would be great if we could have one more as

'limit' => '4' (or some number)

@tripflex
Copy link
Collaborator

+1 I could also integrate this info field editor very easily if core handled it

@mikejolley
Copy link
Contributor

Yeah this could be good to have.

@kochhase
Copy link

Hi Mike,
is there a timeline to integrate it in core, so that myles can enhanced his plugin?

@kochhase
Copy link

kochhase commented Nov 9, 2015

Hi Mike and Myles,
Is there now a way to Limit number of uploaded Files?

Hi, is there something we can hope for?

@tripflex
Copy link
Collaborator

@mikejolley getting a lot of requests for this, any status update on if this will be added to core? Thanks

@mikejolley
Copy link
Contributor

@tripflex How would you think this needs handling? I think the multi-upload script has a setting for it, but we'd need to pass the max limit to it somehow.

@jonathandezoete
Copy link

Semi/temp solution for this:

jQuery(function() {
       jQuery('.wp-job-manager-file-upload[multiple]').on('click', function(e) {
          if(jQuery('.job-manager-remove-uploaded-file').length > 5) { alert('Max 6 images'); e.preventDefault() ;}
       });
    });

@ekajuan
Copy link

ekajuan commented Feb 19, 2016

If the limit is set to 5, why not just create 5 boxes of image uploader? Each box can only be filled with 1 image. The upload method can by selecting an image or drag and drop

@designlab9898
Copy link
Author

Is this feature possible?

@jammin138
Copy link

Does anyone know if this is coming anytime soon? Would be a fantastic feature!

@ghost
Copy link

ghost commented Mar 25, 2016

Guys,

Where i imput that code:

jQuery(function() {
jQuery('.wp-job-manager-file-upload[multiple]').on('click', function(e) {
if(jQuery('.job-manager-remove-uploaded-file').length > 5) { alert('Max 6 images'); e.preventDefault() ;}
});
});

Please, update the plugin with the limit option, that causing a lot of problems for me.

Thanks for all!

Rafael

@jammin138
Copy link

@mikejolley @tripflex , Hey guys, is this something you're still looking in to doing? Any ideas if how we can get this off the ground? Will this be supported in future updates if we can get this up and running.

best wishes

@davoraltman
Copy link

+1 2672102-t

@bbostan
Copy link

bbostan commented May 27, 2016

Hey guys,

this is a very importan point. What is the current status of that implementation? How can I use the code, which is commented above?

Please help! Please!!! :D

@jammin138
Copy link

@bbostan I agree, this is an important feature. Unfortunately I've not been getting any feedback on it's status and I've resulted in manually limiting the amount of images that are uploaded. Far from perfect.

@bbostan
Copy link

bbostan commented May 29, 2016

@jammin138 can you maybe help me to limit the amount of images manually? (My E-Mail is [email protected] ... )

@jammin138
Copy link

@bbostan I quite literally have to check new submitted listings as they're uploaded. Not ideal, but it works. It allows me to offer customers with free listings a restricted amount of images and paid user unlimited images.

@bbostan
Copy link

bbostan commented Jun 12, 2016

@jonathandezoete Hey Jonathan, where do we have to input the commented code for your solution? A lot of people are asking for that ... 👍

@jonathandezoete
Copy link

You can output it anywhere on the page where the upload fields are showing!
I have it in a child theme that overwrites the templates/job-submit.php file. So that would be a good place.

@bbostan
Copy link

bbostan commented Jun 28, 2016

@mikejolley Is it not time to implement this feature?

@jammin138
Copy link

jammin138 commented Jul 3, 2016

I managed to get the code working that @jonathandezoete kindly supplied. I'm using "WP Job Manager Field Editor" with my website and put that code into the job "description" field itself. The issue I'm having is if a user uploads one image at a time it works fine, but the user selects multiple images to upload the code doesn't work. I don't suppose anyone has a fix for this?

bw,

@bbostan
Copy link

bbostan commented Jul 3, 2016

@jammin138 Can you maybe expain how exactly you put the code in to the descripton field? Do you really mean it like the picture. I can't believe that this will work ...
github
..

@jammin138
Copy link

jammin138 commented Jul 3, 2016

@bbostan you have to surround the code with script tags:

<script>
jQuery(function() {
       jQuery('.wp-job-manager-file-upload[multiple]').on('click', function(e) {
          if(jQuery('.job-manager-remove-uploaded-file').length > 5) { alert('Max 6 images'); e.preventDefault() ;}
       });
    });
</script>

my genius mate @mikezs helped me

@designlab9898
Copy link
Author

hi guys, if you got this feature working with WP Job Manager - Fields
Editor UI, please let me know. if it works, we can set different Job
Packages and set each File Uploaded Limit for each different Package. Free
Package (maybe accept only up to 5 images), Basic Package (up to 10-15
images), Pro Package (unlimited images can be uploaded), that would be
really cool, when this feature is added directly into Fields Editor plugin.
thanks for all the help

On Mon, Jul 4, 2016 at 4:12 AM, jammin138 [email protected] wrote:

@bbostan https://github.com/bbostan you have to surround the code with
script tags:

(Code here)
</script>```

I'm on mobile so I can't copy and paste the entire code sorry


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#516 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/ANNiDOCR_lfL31vhscBYJC02py5OUfHrks5qSBfEgaJpZM4FtobJ
.

Sent by,
DesignLab Solutions *
*JM0697683-V

Contact Number: +6017 788 6632 (MR. ALVIN GAN)

PREMIER COMPANY ADVERTISING, WEBSITE DESIGN, E-COMMERCE, PLATFORM
CUSTOMIZATIONS, SUPPORT & TRAINING

@Goakgoak
Copy link

Goakgoak commented Jul 4, 2016

I tried the solution as in the picture above, surrounded by script tags, and all the same business as before, users can upload as many pictures as they want.
picturemax

@ghost
Copy link

ghost commented Jul 4, 2016

Guys,

this feature is very important for everbody.

Is not just on Image Gallery, this option need to be able on all fields like category or tags.

We are waiting.

@Goakgoak
Copy link

Goakgoak commented Jul 4, 2016

Tags
Listing -> settings -> submission.

@jammin138
Copy link

@brasilh

This is a picture of it setup on my website. Like I've said the issue I have is if the user tries to upload more then one image at a time the code doesn't work. It only works when a use uploads each image individually.

Ideally I think something should be set up so that users can upload a limited amount of images for free and if they pay for a more "premium" account they then get more images...

screen shot 2016-07-04 at 18 37 24

@Goakgoak
Copy link

Goakgoak commented Jul 4, 2016

Yes, I had first uploaded one by one very fast, now one by one until is fully uploaded, and no difference.

@infernal31
Copy link

Oh god one years i really want to cry

@tripflex
Copy link
Collaborator

It's on the way to be included with the next release of Field Editor plugin, hopefully getting it out this week (plan is for tomorrow)

@Goakgoak
Copy link

Sorry about the stupid question, do we need to call Jquery somewhere else?
Because I added that script in my description and didn't make the trick.
On the bright side, I was happy to hear the last email that we will have
that option out of the box. Thank you.

On Mon, Jul 4, 2016 at 10:43 AM, jammin138 [email protected] wrote:

@brasilh https://github.com/brasilh

This is a picture of it setup on my website. Like I've said the issue I
have is if the user tries to upload more then one image at a time the code
doesn't work. It only works when a use uploads each image individually.

Ideally I think something should be set up so that users can upload a
limited amount of images for free and if they pay for a more "premium"
account they then get more images...

[image: screen shot 2016-07-04 at 18 37 24]
https://cloud.githubusercontent.com/assets/17796043/16567488/22b37654-4217-11e6-90dc-d6b9d32aa567.png


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#516 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AQd2s9YqcdnSb9Ntwg6W9keqwTLUiR5Jks5qSUZdgaJpZM4FtobJ
.

@jammin138
Copy link

@tripflex I'm going to give you a virtual high five when this comes out! Great work

@juniorterin
Copy link

jQuery slice may solve this problem with a client-side parse

var $limiteDeFotos = 5; // how much uploads

var $auto_refresh = setInterval(function () {

$('.main-class-of-your-field .job-manager-uploaded-files > .job-manager-uploaded-file').slice($limiteDeFotos).remove();

$autoUpdate();
}, 1000);

@tarrazon
Copy link

Hi, nobody find a solution ?

@jammin138
Copy link

@tripflex It's up running perfectly! Thanks for adding this feature, great work.

@tripflex
Copy link
Collaborator

Hey sorry guys forgot to post on here, the latest update 1.5.0 includes this new feature, plus enhancements I made to it.

Initial check is done on frontend using JavaScript/jQuery for maximum images, both for ajax and non-ajax uploads. Once the user submits the listing, it is also checked via PHP to make sure nobody works their way around the frontend JavaScript.

If the field doesn't have a custom description, it will also now show the max files allowed next to max filesize

Here's the changelog for latest:
http://plugins.smyl.es/wp-job-manager-field-editor/changelog

@ghost
Copy link

ghost commented Mar 4, 2017

Hi, I would like to output the images as a modal image gallery (with lightbox). Is anyone here achieved such functionality with custom code or have heard of such plugin? Where should I start?

@tripflex
Copy link
Collaborator

@DomMTL just noticed your reply when reviewing this, the latest version of field editor now includes a new output as "WordPress Image Gallery" which will output thumbnails and then open then in a lightbox when clicked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.