Yii Framework Forum: SWFUpload Issues an Usage Discussion - Yii Framework Forum

Jump to content

  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

SWFUpload Issues an Usage Discussion Rate Topic: -----

#21 User is offline   jjmf 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 60
  • Joined: 10-November 08

Posted 19 May 2011 - 06:21 PM

I'm building an upload tool using swfupload. The user will have to fill a form with contact data. This data will be emailed to someone. I would like to send the uploaded file names so I'm trying to save the file names in Yii session but I'm getting error 500 when the upload finishes.
Here is my action that save the files:
public function actionSaveFiles()
    {
        if (!isset(Yii::app()->session['fileNames'])) Yii::app()->session['fileNames'] = array();
        $this->uploadFolder = Yii::app()->basePath . '/../uploads';
        $filedata = $_FILES['Filedata'];
        $result = move_uploaded_file($filedata['tmp_name'],$this->uploadFolder . '/' . $filedata['name']); // Not relative. Full path
        if ($result) {
            Yii::app()->session['arquivosEnviados'][] = $filedata['name'];
        }
    }


If I comment the line bellow, the upload works fine:
Yii::app()->session['arquivosEnviados'][] = $filedata['name'];


How can I store the uploaded file names to sent in an email after the user click the finish button?
0

#22 User is offline   dellzam 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 11-October 11

Posted 16 January 2012 - 05:11 AM

I used swfupload extension before and it works fine until i used it on my new project and i got a weird error.

My new project was at the same hosting and with same configuration with my previous project that was working.

$_POST and $_FILES variables are empty and definitely when post variable was empty it will return a csrf validation error. Charles web debugging proxy reported that it was submitting data but when it reaches the server it was empty.

Below is my debug info.
---SWFUpload Instance Info---
Version: 2.2.0 2009-03-25
Movie Name: SWFUpload_0
Settings:
	upload_url:               /igbl/debugger.php
	flash_url:                /igbl/assets/3c073be/swfupload.swf?preventswfcaching=1326707461787
	use_query_string:         false
	requeue_on_error:         false
	http_success:             
	assume_success_timeout:   0
	file_post_name:           Filedata
	post_params:              [object Object]
	file_types:               *.jpg; *.jpeg; *.gif; *.png; *.pdf; *.doc; *.ppt; *.txt; *.xls
	file_types_description:   Web Files
	file_size_limit:          102400
	file_upload_limit:        20
	file_queue_limit:         0
	debug:                    true
	prevent_swf_caching:      true
	button_placeholder_id:    spanButtonPlaceholder
	button_placeholder:       Not Set
	button_image_url:         /igbl/images/XPButtonUploadText_61x22.png
	button_width:             61
	button_height:            22
	button_text:              
	button_text_style:        color: #000000; font-size: 16pt;
	button_text_top_padding:  0
	button_text_left_padding: 0
	button_action:            -110
	button_disabled:          false
	custom_settings:          [object Object]
Event Handlers:
	swfupload_loaded_handler assigned:  true
	file_dialog_start_handler assigned: true
	file_queued_handler assigned:       true
	file_queue_error_handler assigned:  true
	upload_start_handler assigned:      true
	upload_progress_handler assigned:   true
	upload_error_handler assigned:      true
	upload_success_handler assigned:    true
	upload_complete_handler assigned:   true
	debug_handler assigned:             true

SWF DEBUG: SWFUpload Init Complete
SWF DEBUG: 
SWF DEBUG: ----- SWF DEBUG OUTPUT ----
SWF DEBUG: Version:                2.5.0 2010-03-05 Beta 3.2
SWF DEBUG: movieName:              SWFUpload_0
SWF DEBUG: Upload URL:             /igbl/debugger.php
SWF DEBUG: File Types String:      *.jpg; *.jpeg; *.gif; *.png; *.pdf; *.doc; *.ppt; *.txt; *.xls
SWF DEBUG: Parsed File Types:      jpg,jpeg,gif,png,pdf,doc,ppt,txt,xls
SWF DEBUG: HTTP Success:           0
SWF DEBUG: File Types Description: Web Files (*.jpg; *.jpeg; *.gif; *.png; *.pdf; *.doc; *.ppt; *.txt; *.xls)
SWF DEBUG: File Size Limit:        104857600 bytes
SWF DEBUG: File Upload Limit:      20
SWF DEBUG: File Queue Limit:       20
SWF DEBUG: Post Params:
SWF DEBUG:                         YII_CSRF_TOKEN=2053931939f1ba96105df7d705ab17b87ebfc36e
SWF DEBUG:                         PHPSESSID=1fe5bc5cce9d1f95daa20fd5f589f88b
SWF DEBUG: ----- END SWF DEBUG OUTPUT ----


debugger.php is just a plain php script that var_dump $_POST variable to isolate yiiframework from the problem.
0

#23 User is offline   dellzam 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 11-October 11

Posted 17 January 2012 - 01:09 AM

problem solve. it has something to do with my .htaccess
0

Share this topic:


  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users