Forums / Developer / File uploading in two steps

File uploading in two steps

Author Message

Alex xxx

Wednesday 23 April 2008 12:57:30 am

Sorry for my bad english :)

I have content class "UploadedFile" with attributes:
Description (datatype: text line),
UploadDate (datatype: date),
Password (datatype: text line)
UploadFile (datatype: file)

I want to create form for creating new "UploadedFile" objects in two steps:
1 step: Only uploading file
2 step: Fill "description", "password" fields and publish object

How I can create this "wizard" form?

Thank you :)

Alex xxx

Wednesday 23 April 2008 5:15:53 am

The form with file upload field must be visible at the main page (not after click at some button), so, content object "uploaded file" must be created when the file is already uploaded.

I have no ideas how to do this... please, help!

André R.

Wednesday 23 April 2008 7:33:33 am

Take a look at the content/upload module, it will allow you to upload content directly, and settings from content.ini will be used to determinate what class should be created based on file type.

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Alex xxx

Wednesday 23 April 2008 8:10:13 am

Thank you for answer.
I have understood how to upload a file, but there is question - how to add additional information about the file right after uploading, and how to link this information with uploaded file.

André R.

Wednesday 23 April 2008 8:30:47 am

You can have object name and location as form values while uploading (browse to /content/upload to see form input names if you haven't already), normally you will be redirected to the uploaded file, and there you can have a edit button to let the user further edit the object(see for instance in the forum templates for how this edit button should be set up).

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Alex xxx

Wednesday 23 April 2008 8:45:11 am

I want to view object edit form (to fill information about uploaded file) RIGHT AFTER upload.
And object must be published (or visible, as variant) only after user filled second form.
Can I specify content/upload to redirect to object editing mode after the upload?

Alex xxx

Wednesday 23 April 2008 8:56:28 am

Example:
http://img217.imageshack.us/my.php?image=uploadhq1.jpg

André R.

Wednesday 23 April 2008 11:53:26 am

> Can I specify content/upload to redirect to object editing mode after the upload?

No, you'll have to create your own module / view for uploading to accomplish that, since content edit needs the object id witch isn't created before the upload is completed.

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Alex xxx

Wednesday 23 April 2008 12:29:16 pm

Thank you, I'll try to create own module.

eZ debug

Timing: Jan 18 2025 16:07:16
Script start
Timing: Jan 18 2025 16:07:16
Module start 'content'
Timing: Jan 18 2025 16:07:16
Module end 'content'
Timing: Jan 18 2025 16:07:16
Script end

Main resources:

Total runtime0.7699 sec
Peak memory usage4,096.0000 KB
Database Queries212

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0063 589.1406180.8359
Module start 'content' 0.00630.6296 769.9766605.9219
Module end 'content' 0.63590.1339 1,375.8984341.0625
Script end 0.7698  1,716.9609 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00390.5093210.0002
Check MTime0.00140.1871210.0001
Mysql Total
Database connection0.00060.079910.0006
Mysqli_queries0.694190.16132120.0033
Looping result0.00220.28412100.0000
Template Total0.741796.320.3709
Template load0.00200.254820.0010
Template processing0.739896.091720.3699
Template load and register function0.00020.030410.0002
states
state_id_array0.00160.209810.0016
state_identifier_array0.00090.118520.0005
Override
Cache load0.00170.2208390.0000
Sytem overhead
Fetch class attribute can translate value0.00190.245030.0006
Fetch class attribute name0.00090.1208100.0001
XML
Image XML parsing0.00080.110230.0003
class_abstraction
Instantiating content class attribute0.00010.0075120.0000
General
dbfile0.00180.2318280.0001
String conversion0.00000.000930.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
9content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
11content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
5content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 30
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs