Formbuilder > Add file-uploader field

jeroendesloovere's Avatar

jeroendesloovere

07 Sep, 2011 03:05 PM

For generating CV pages, people often have to upload their CV.
Are you guys adding any fields like "file-upload" in the near future?

Greetz

  1. Support Staff 1 Posted by tijs on 07 Sep, 2011 09:15 PM

    tijs's Avatar

    Hmm, good request, but I think we should this one trough. If we introduce a file-field we need multiple validators (filetype, dimensions, ...) And the validators should be dynamic so you could enter the allowed types.

  2. Support Staff 2 Posted by dieter on 08 Sep, 2011 06:28 AM

    dieter's Avatar

    We excluded the filefield because of the potential dangers it includes. Every form created is publicly visible, which directly means that everybody can start uploading files to your server/website. Even with all the needed validation (filesize, extension, mimetype), a user could still upload a large number of files. This might cause your diskspace and bandwidth limits to be exceeded. A person with understanding of the possible dangers could tighten the validation so the risk is minimal. But we have to take in account that Fork its target audience is not only the power users but also the users who have a more limited understanding of the dangers.

    We are working on a way that allows you create pages which are protected by a login. After that we will revise the fileupload field.

  3. dieter closed this discussion on 08 Sep, 2011 06:28 AM.

  4. jeroendesloovere re-opened this discussion on 06 Oct, 2011 08:46 AM

  5. 3 Posted by jeroendesloover... on 06 Oct, 2011 08:46 AM

    jeroendesloovere's Avatar

    I've implemented the file-upload-field throughout the entire formbuilder (frontend/backend).
    Everything works fine, validates and uploads the file.

    Questions

    • @tijs, what do you mean by dimensions?
    • @dieter, you have a point there, it contains dangers, but when we narrow down the allowed mime-types, everything would be alright...
    • What are the correct "mime-types" for a .doc and a .pdf? Can't seem to get this working, submitting images has no problems.

    I'm using this:
    // extensions ->isAllowedExtension(array('gif', 'jpg', 'jpeg', 'png', 'tiff', 'doc', 'docx', 'xsl', 'xslx', 'ppt', 'pptx', 'txt', 'rtf', 'pdf')

    // mime types ->isAllowedMimeType(array('image/gif',

                                    'image/jpg', 'image/jpeg', 'image/pjpeg', 'image/png', 'image/tiff', 
                                    'text/plain', 'appl/text', 
                                    'application/download', 'application/msword', 'application/word', 'application/vnd.msword', 'application/winword', 'application/x-msw6', 'application/x-msword',
                                    'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/octet-stream', 
                                    'application/excel', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 
                                    'application/powerpoint', 'application/vnd.ms-powerpoint', 'application/vnd.openxmlformats-officedocument.presentationml.presentation', 
                                    'application/pdf', 'application/x-pdf', 'application/x-download')
    
  6. 4 Posted by jeroendesloover... on 06 Oct, 2011 09:52 AM

    jeroendesloovere's Avatar

    I've got another question when the form is correctly validated:

    When sending the form-fields in an email, I added this to a file
    '< a href="'.FRONTEND_FILES_URL.'/form_builder/'.$fieldData['value'].'">'.$fieldData['value'].'< /a>'

    And also in the database, so users just have to click on the file and it will open.

    But then for the export, people see this a href... stuff.

    Is there a workaround so fork automatically adds <a href... in mail and backend/formbuilder and not in the database?

  7. 5 Posted by jeroendesloover... on 06 Oct, 2011 11:48 AM

    jeroendesloovere's Avatar

    I have an idea for a hook which is added when you have a form with a file-upload.

    When I delete a form-post, I want it to delete the FRONTEND UPLOADED FILE as well.

    Is this possible?

  8. Support Staff 6 Posted by tijs on 06 Oct, 2011 08:22 PM

    tijs's Avatar

    Jeroen, what I mean by dimensions, is when I add a field for images in the form, I want to be able to set the minimal and maximum dimensions.
    Another issue (mentioned by Dieter) is that someone can upload many large files to your server through this form.

    The mimetype for word is: application/msword (don't know if .docx uses them also), pdf uses: application/pdf

    I don't think you should wrap the link with an a-tag in the database-entry. If they open the CSV in Excel/Numbers it will be converted into a link.

    At this moment there isn't a hook on deleting items. Don't know if this should use an hook.

  9. 7 Posted by andrea4me on 24 Aug, 2012 01:41 PM

    andrea4me's Avatar

    hi, i need to add an upload input type... how can I do?

    tnx a lot

  10. 8 Posted by andrea4me on 27 Aug, 2012 09:31 AM

    andrea4me's Avatar

    hi jeroendesloovere

    how can I add a file-upload for my CV module? can you help me please?

    tnx a lot

  11. 9 Posted by Laurentiu on 03 May, 2013 10:12 AM

    Laurentiu's Avatar

    I've noticed there are several persons here who say they have activated file-upload feature in the CMS' form-builder. I'm still looking how can I activate this feature.

    Can, anybody, to enlighten me?

  12. 10 Posted by Laurentiu Cenus... on 05 May, 2013 08:57 AM

    Laurentiu Cenusa's Avatar

    I don't have this option in Formbuilder.

    Best regards,
    Laurentiu Cenusa.

    Sent from my iPhone

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac