BOARDS

planetluc.com discussion board

all about the planetlu.com scripts

You are not logged in.

Announcement

I had to clean the boards due to massive spam. Actually i deleted everything /-one after 1st Oct 2008. It was the only way to get this spam out of the boards. So i'm sorry for all serious users who registered/posted meanwhile.

#1 25-02-2008 21:51:16

Vibe
New member
Registered: 25-02-2008
Posts: 3

Restrict Attachment Type & Size

Hello,

Lukas' FormPro script is fantastic - very easy to configure and work with - thank you!

Is it possible to Restrict attachment types & sizes? (e.g. limit attachments to .doc/.txt/.rtf files as well as total uploaded file size?)

Thanks again for some great code!

Offline

 

#2 26-02-2008 01:59:53

sidtheduck
Moderator
From: down by the water
Registered: 14-07-2006
Posts: 515
Website

Re: Restrict Attachment Type & Size

Vibe,

It would be possible, but only from the backend (after the form has been submitted) with PHP or with some javascript, but it's a little clunky from what I've seen.  Let me look into it a little more to see if I can find something more elegant before responding to you.


If it looks like a duck, and quacks like a duck, we have at least to consider the possibility that we have a small aquatic bird of the family anatidae on our hands.                ~Douglas Adams~

Offline

 

#3 26-02-2008 16:57:01

Vibe
New member
Registered: 25-02-2008
Posts: 3

Re: Restrict Attachment Type & Size

Hi sidtheduck,

Thanks so much for your quick reply! 

I have used an excellent PHP/Perl upload script (Uber-Uploader) that allows this type of functionality (restriction based on size/file extension) - I will see if anything can be adapted and post back as well.  Having this functionality would make FormPro a 110% solution (vs. the 105% solution that is is now :-).

Offline

 

#4 26-02-2008 19:56:21

sidtheduck
Moderator
From: down by the water
Registered: 14-07-2006
Posts: 515
Website

Re: Restrict Attachment Type & Size

Vibe,

I've never used Uber-Upload, but I've used flash based uploaders in the past (SWFupload + FancyUpload).  They allow the same functionality (or more with Flash 9), but again, this adds reliance on Perl or Flash.  I don't think there is a way to check for file size using Javascript alone, but you can check for file type.  However, PHP can check for both, but it means that the user may have wasted upload time for a file that is larger than the upload_max_filesize.

I can probably help you set up Uber-Uploader to work with formpro, but I'm not sure if it will work for everyone's server installations, so it may not make it into the default download.

Let me know.
Thanks.


If it looks like a duck, and quacks like a duck, we have at least to consider the possibility that we have a small aquatic bird of the family anatidae on our hands.                ~Douglas Adams~

Offline

 

#5 27-02-2008 18:09:20

Vibe
New member
Registered: 25-02-2008
Posts: 3

Re: Restrict Attachment Type & Size

Hi sidtheduck,

Thank you so much for your generous offer - it is VERY  appreciated!

After thinking about what you mention (check for file = wasted upload) I completely agree.  I had the same issue with Uber-Uploader - a friend tried to upload a 100 MB file when I set a limit for 75 MB.  Needless to say I received an "ear full" after they waited for the upload to complete :-).

With this in mind I guess the best option would be a simple Javascript test for the attachment file type (no need for Uber-uploader integration).  I have found several Javascript functions online - however, this will definitely take some tinkering (not sure how to integrate with FormPro + not a Javascript guru, only a designer :-). 

Do you have any recommendations or possibly a direction to point me to?

Thanks so much for your time and assistance!

Offline

 

#6 19-08-2008 14:57:57

itsmejason
Member
Registered: 05-11-2007
Posts: 11

Re: Restrict Attachment Type & Size

Did you ever figure out how to restrict file type? Thanks.

Last edited by itsmejason (19-08-2008 14:58:25)

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson

 
 
© 2003-2010 by planetluc.com · Bachtelstrasse 104 · CH-8400 Winterthur | Support | Login |