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)

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

Another question here:

Is there a way to have the upload dialog box only prompt for one upload at a time? We want to keep this as a single record, though, because we want to limit the total number of uploads to 25.

So, instead of having 10 upload flelds in the upload dialog box, there would be only one, but it would still say how many uploads were allowed and how many additional could be uploaded. We would only want to apply this to one section, though, so we wouldn't want it to be a global change.

I'm guessing that this is not possible, but I thought I'd just throw it out there to see.

Thanks!


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

Dwelling Productions

www.dwellingproductions.com

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: [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