How to make contact form with file upload

Author Message

Marco Zinn

Thursday 07 February 2008 7:50:07 am

Hi there,

i want to modify a contact form (which is based on information collectors) by adding a file attribute.
The user filling out the form should be able to upload a file to the ez system.

Two question here:
1- As far as i can see, that file attribute does not allow to set the information collector "flag". I guess, this is a design decision. Do you have an idea on how to solve or mimic the needed feature?
2- If the above can be solved, how can we attach the uploaded file to the mail, that is sent to the receiver? This would require a function to encode a binary file as a mail attachment.
Or, how can I at least send a link to the file's location on the server with that email?

I know, that this procedure may introduce security issues...

The only solution that i can think of at the moment is to drop the information collector concept here and let the user (who may be anonymous) create an object (just like a forum post) and use the notification system to inform a user about new objects.
But still, i think, i cannot attach the file to the notification mail, right?

Marco
http://www.hyperroad-design.com

Felix Laate

Thursday 07 February 2008 11:19:41 am

Hi Marco!

I choose to do this with a separate module: http://ez.no/developer/contribs/applications/sendappform

Could this help you?

Felix

Publlic Relations Manager
Greater Stavanger
www.greaterstavanger.com

Marco Zinn

Thursday 14 February 2008 5:34:41 am

Hi Felix,

thank you for the hint. I saw this extension some time ago, but forgot about it in the meantime.
I'll give it a try, it looks good.

Marco
http://www.hyperroad-design.com

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 18:22:06
Script start
Timing: Jan 18 2025 18:22:06
Module start 'layout'
Timing: Jan 18 2025 18:22:06
Module start 'content'
Timing: Jan 18 2025 18:22:07
Module end 'content'
Timing: Jan 18 2025 18:22:07
Script end

Main resources:

Total runtime0.7901 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0050 588.0469152.6406
Module start 'layout' 0.00500.0030 740.687539.4766
Module start 'content' 0.00800.7805 780.1641542.6797
Module end 'content' 0.78850.0016 1,322.843812.1250
Script end 0.7900  1,334.9688 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00360.4505160.0002
Check MTime0.00130.1668160.0001
Mysql Total
Database connection0.00080.102410.0008
Mysqli_queries0.739393.5717570.0130
Looping result0.00060.0740550.0000
Template Total0.760096.220.3800
Template load0.00200.254920.0010
Template processing0.758095.942020.3790
Template load and register function0.00010.012410.0001
states
state_id_array0.00130.160810.0013
state_identifier_array0.00100.130120.0005
Override
Cache load0.00170.2170250.0001
Sytem overhead
Fetch class attribute can translate value0.00110.135620.0005
Fetch class attribute name0.00110.140250.0002
XML
Image XML parsing0.00130.164920.0007
class_abstraction
Instantiating content class attribute0.00000.001460.0000
General
dbfile0.00100.1249220.0000
String conversion0.00000.001140.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 19
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs