File Type Validation

Author Message

Paul Kinzett

Sunday 14 October 2007 8:50:10 pm

Hi

I have a custom class and a form which allows anyone to create objects of this class on the website.

I have created a template file called file_validation.tpl which contains a template operator which will validate a file based on the mime type.

The file validation works fine, but what I would like to happen is if the file is not valid then reload the form and display a message otherwise submit the form. Basically the same way as how edit_validation.tpl works.

Does anyone have any ideas on how I could get this to work?

Cheers,
Paul

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 19:21:45
Script start
Timing: Jan 18 2025 19:21:45
Module start 'layout'
Timing: Jan 18 2025 19:21:45
Module start 'content'
Timing: Jan 18 2025 19:21:46
Module end 'content'
Timing: Jan 18 2025 19:21:46
Script end

Main resources:

Total runtime1.1239 sec
Peak memory usage4,096.0000 KB
Database Queries46

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0062 588.9297152.6094
Module start 'layout' 0.00620.0032 741.539139.4141
Module start 'content' 0.00941.1130 780.9531399.9375
Module end 'content' 1.12240.0015 1,180.89068.1875
Script end 1.1239  1,189.0781 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.3079160.0002
Check MTime0.00130.1191160.0001
Mysql Total
Database connection0.00080.072210.0008
Mysqli_queries1.082096.2677460.0235
Looping result0.00050.0453440.0000
Template Total1.088196.820.5440
Template load0.00230.204320.0011
Template processing1.085896.603420.5429
Template load and register function0.00020.019310.0002
states
state_id_array0.00150.131910.0015
state_identifier_array0.00170.147420.0008
Override
Cache load0.00180.1645100.0002
Sytem overhead
Fetch class attribute can translate value0.00180.157710.0018
Fetch class attribute name0.00060.051810.0006
XML
Image XML parsing0.00010.007310.0001
class_abstraction
Instantiating content class attribute0.00000.000310.0000
General
dbfile0.00070.0611100.0001
String conversion0.00000.000740.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
1content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
2content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/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: 6
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs