Difference between #3 and #5 of
XUpload Workflow

Changes

Title unchanged

XUpload Workflow

Category unchanged

Tutorials

Yii version unchanged

Tags unchanged

xupload, Forms, Widgets, tutorial

Content changed

Today I'm going tohis wiki describes a more complex workflow using the [XUpload](http://www.yiiframework.com/extension/xupload/ "XUpload") widget
 
If you want to know how to send additional data with your files like title, or description, check [this other wiki](http://www.yiiframework.com/wiki/395/additional-form-data-with-xupload/ "sending additional data")
 
 
The workflow will basically go like this:

Workflow
[...]
```php
// application/controllers/FancyController.php
 
 
public function actionForm( ) {
$model = new SomeModel;
Yii::import( "xupload.models.XUploadForm" );
[...]
```php
// application/views/fancy/form.php
 
 
<fieldset>
<?php
$form = $this->beginWidget('CActiveForm', array(
[...]
```php
<?php
// application/controllers/FancyController.php
 
 
public function actionUpload( ) {
Yii::import( "xupload.models.XUploadForm" );
//Here we define the paths where the files will be stored temporarily
[...]
```php
<?php

 
// application/controllers/FancyController.php
 
 
public function actionForm( ) {
$model = new SomeModel;
Yii::import( "xupload.models.XUploadForm" );
$photos = new XUploadForm;
//Check if the form has been submitted
if( isset( $_POST['SomeModel'] ) ) {
[...]
28 0
42 followers
Viewed: 96 324 times
Version: 1.1
Category: Tutorials
Written by: Asgaroth
Last updated by: Asgaroth
Created on: Jul 2, 2012
Last updated: 12 years ago
Update Article

Revisions

View all history