Force upload field to only allow one upload at a time

5 posts by 2 authors in: Forums > CMS Builder
Last Post: February 24, 2009   (RSS)

Re: [dwelling] Force upload field to only allow one upload at a time

By Dave - February 23, 2009

Hi Jeremy,

You can limit the max uploads allowed for a specific upload field under: Admin > Section Editors > Your Upload Field > Maximum uploads (click to show input alidation options).

It sounds like you want to allow 25, though, but only have the user upload one at a time. Is that right? I'm not sure exactly what you're trying to do. Can you give me some more details?

Thanks!
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Force upload field to only allow one upload at a time

Hi Dave!

Yes that's right. I want to allow a total of 25 uploads, but I would like to limit the user to only allow them to upload those one at a time. (This is because they are uploading very large audio and video files and we've had upload issues when trying to upload more than one at a time. Otherwise, doing them one at a time works just fine.)

Thanks!

Jeremy
---------------------------

Dwelling Productions

www.dwellingproductions.com

Re: [dwelling] Force upload field to only allow one upload at a time

By Dave - February 24, 2009

Hi Jeremy,

The software doesn't support changing the number of upload fields displayed but if you are comfortable editing PHP you can make this change yourself. Here's the instructions:

- Open this file: cmsAdmin/lib/menus/default/uploadForm.php
- Make a backup copy of that file
- Search for "range" and find this line (around line 85)
<?php foreach (range(1, (int) min($uploadsRemaining, 10)) as $count): ?>

And change the number (10) in red to 1, like this:
<?php foreach (range(1, (int) min($uploadsRemaining, 1)) as $count): ?>

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Force upload field to only allow one upload at a time

By dwellingproductions - February 24, 2009 - edited: February 24, 2009

Dave,

Thanks! That works perfectly. Now comes the tricky part... trying to decide whether or not to keep this limit imposed. I know they'd appreciate being able to upload multiple files to the gallery, for instance. If the one at a time thing is bugging them for that, I guess I could try just making a big note that says, "only upload one file at a time" for areas where larger files will be uploaded. Of course, since most people don't tend to like following directions, I have a feeling I'll be sticking with this trick. :-)

Much appreciated!

Jeremy
---------------------------

Dwelling Productions

www.dwellingproductions.com