I have created a slideshow module where it has a custom content type for slides, so each slide is a node.
I have used the upload module to allow the user to upload the image to use for the slideshow, but this allows you to upload multiple images. This doesn't cause any errors, as my script will just get the first result from the database, but ideally I would like to limit the upload form on my custom content type to only allow jpg, gif or png and only allow 1 image to be uploaded per node.
I can't see anything that would allow me to do this, so I think the only way is to have some ugly override.
For the image type I suppose I can put in some validation for the file upload, but I wouldn't want to have to wait until validation to find out the user has uploaded 100 images to one slide (because we all know, that is the sort of thing users do.)
Comments
Go here
go to /admin/settings/uploads and change the default permitted file types....
Im not aware of how to allow only one image per upload but you can limit the size of the file upload so it can help limit the file upload to only one....
http://www.mytechdaily.com
Unfortunately I only want
Unfortunately I only want the restrictions to apply on my content types and not the rest of the site as I want to allow PDF and DOC uploads on pages and stories.
Is there anyway to pull this validation from the upload module and only apply it to certain forms using $form_id?
Action Medical Research - www.action.org.uk
James T
Action Medical Research - www.action.org.uk
Can you create a custom
Can you create a custom content type with a single image field? You need the CCK and imagefield modules.
----------------------------------------------------------------------
http://www.bwv810.com/
I am a writer and researcher. In my spare time I build websites with Drupal.
Je peux communiquer en français. / Я могу общаться на русском языке.
I was hoping to keep the
I was hoping to keep the dependencies to a minimum although our completed site will most likely use CCK in the end, if I ever do release this module, it will be more work for others to make it work.
But if this is the only way to do it without having a lot of ugly code doing what it shouldn't then I will have to use it, although as I said being able to upload more than 1 file isn't a problem, it's just a waste of time if you upload more than one.
Action Medical Research - www.action.org.uk
James T
Action Medical Research - www.action.org.uk
try it
I cant seem to find a way to help you on this.... without coding a solution... using what is already offer(cck and imagefield) is best... also if you release the code back to drupal youll just need to let people know what the dependencies are....itll save time and hassle for you atleast... and most sites end-up using cck and imagefield modules anyway...
Dasith.
http://www.mytechdaily.com
New Upload max files module
jamestamr - not sure if this is still relevant to you, but this new module seems to offer what you wanted: http://drupal.org/project/upload_maxfiles