Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

DataObjectManager Module /

Discuss the DataObjectManager module, and the related ImageGallery module.

Moderators: martimiz, UncleCheese, Sean, Ed, biapar, Willr, Ingo, swaiba

Upload image stuck in "Processing"


Go to End


31 Posts   11693 Views

Avatar
UncleCheese

Forum Moderator, 4102 Posts

2 July 2010 at 3:51am

Turn on SWFUpload debugging in your _config.php

SWFUploadConfig::debug();

Upload a file, and post the output.

Avatar
Graphicator

Community Member, 62 Posts

2 July 2010 at 5:58pm

It is not the module's error. A change in the Sapphire directory will fix it from being stuck in 'processing' I had the same problem tonight and resolved the problem with this fix: http://open.silverstripe.org/attachment/ticket/5547/2.4.0-FileUpload.diff

Found this discussion here to help: http://silverstripe.org/general-questions/show/281744?start=8

Avatar
Jeremy

Community Member, 1 Post

5 July 2010 at 2:17pm

I'm also having this problem. I've done the fix as linked above, which got other uploads working, but not the swfupload. The strange thing is that it works fine on my local test server, but not on my web host's? So I'm guessing it's just a PHP setting causing it but haven't been able to work out which one.

---SWFUpload Instance Info---
Version: 2.2.0 Alpha
Movie Name: SWFUpload_0
Settings:
	upload_url:               http://*domain*/FileDataObjectManager_Controller/handleswfupload
	flash_url:                http://*domain*/swfupload/javascript/swfupload.swf?swfuploadrnd=621986462
	use_query_string:         false
	file_post_name:           swfupload_file
	post_params:              [object Object]
	file_types:               
	file_types_description:   
	file_size_limit:          20MB
	file_upload_limit:        20
	file_queue_limit:         20
	debug:                    true
	prevent_swf_caching:      true
	button_placeholder_id:    spanButtonPlaceholder
	button_image_url:         http://*domain*/swfupload/images/upload_button.png
	button_width:             180
	button_height:            24
	button_text:              <span class='button'>Upload files</span>
	button_text_style:        .button { font-family: Helvetica, Arial, sans-serif; font-size: 12px; }
	button_text_top_padding:  6
	button_text_left_padding: 6
	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: Build Number:           SWFUPLOAD 2.2.0 Alpha 2008-10-17
SWF DEBUG: movieName:              SWFUpload_0
SWF DEBUG: Upload URL:             http://*domain*/FileDataObjectManager_Controller/handleswfupload
SWF DEBUG: File Types String:      *.*
SWF DEBUG: Parsed File Types:      
SWF DEBUG: File Types Description:  ()
SWF DEBUG: File Size Limit:        20971520 bytes
SWF DEBUG: File Upload Limit:      20
SWF DEBUG: File Queue Limit:       20
SWF DEBUG: Post Params:
SWF DEBUG:                         dataObjectFieldName=
SWF DEBUG:                         dataObjectClassName=File
SWF DEBUG:                         hasDataObject=0
SWF DEBUG:                         OverrideUploadFolder=assets/News-article-images/
SWF DEBUG:                         fileClassName=File
SWF DEBUG:                         fileFieldName=Files
SWF DEBUG:                         PHPSESSID=tmuhtrt8ba48cjah75gfk8gk71
SWF DEBUG:                         parentIDName=ParentID
SWF DEBUG:                         controllerID=6
SWF DEBUG: ----- END SWF DEBUG OUTPUT ----
SWF DEBUG: 
SWF DEBUG: Event: fileDialogStart : Browsing files. Multi Select. Allowed file types: *.*
SWF DEBUG: Select Handler: Received the files selected from the dialog. Processing the file list...
SWF DEBUG: Event: fileQueued : File ID: SWFUpload_0_0
SWF DEBUG: Event: fileDialogComplete : Finished processing selected files. Files selected: 1. Files Queued: 1
SWF DEBUG: StartUpload: First file in queue
SWF DEBUG: Event: uploadStart : File ID: SWFUpload_0_0
SWF DEBUG: Global Post Item: dataObjectFieldName=
SWF DEBUG: Global Post Item: dataObjectClassName=File
SWF DEBUG: Global Post Item: hasDataObject=0
SWF DEBUG: Global Post Item: OverrideUploadFolder=assets/News-article-images/
SWF DEBUG: Global Post Item: fileClassName=File
SWF DEBUG: Global Post Item: fileFieldName=Files
SWF DEBUG: Global Post Item: PHPSESSID=tmuhtrt8ba48cjah75gfk8gk71
SWF DEBUG: Global Post Item: parentIDName=ParentID
SWF DEBUG: Global Post Item: controllerID=6
SWF DEBUG: ReturnUploadStart(): File accepted by startUpload event and readied for upload.  Starting upload to http://*domain*/FileDataObjectManager_Controller/handleswfupload for File ID: SWFUpload_0_0
SWF DEBUG: Event: uploadProgress (OPEN): File ID: SWFUpload_0_0
SWF DEBUG: Event: uploadProgress: File ID: SWFUpload_0_0. Bytes: 854. Total: 854

Any help would be most appreciated

Avatar
Graphicator

Community Member, 62 Posts

7 July 2010 at 10:23am

I went through the troubleshooting for swfupload because I ran into a problem with the FileDataobjectManager.php.
When Uploading a pdf... I ran the die(hello) and found the error caused by this line

SWF DEBUG: ReturnUploadStart(): File accepted by startUpload event and readied for upload.  Starting upload to http://.....com/FileDataObjectManager_Controller/handleswfupload for File ID: SWFUpload_0_0
SWF DEBUG: Event: uploadProgress (OPEN): File ID: SWFUpload_0_0
SWF DEBUG: Event: uploadProgress: File ID: SWFUpload_0_0. Bytes: 32768. Total: 137666
SWF DEBUG: Event: uploadProgress: File ID: SWFUpload_0_0. Bytes: 98304. Total: 137666
SWF DEBUG: Event: uploadProgress: File ID: SWFUpload_0_0. Bytes: 131072. Total: 137666
SWF DEBUG: Event: uploadProgress: File ID: SWFUpload_0_0. Bytes: 137666. Total: 137666
SWF DEBUG: Event: uploadError: HTTP ERROR : File ID: SWFUpload_0_0. HTTP Status: 500.
SWF DEBUG: Event: uploadComplete : Upload cycle complete.
Error Code: -200, File name: 2007 Form 5500 Schedule I-Financial Information -- Small Plan.pdf, File size: 137666, Message: 500

$ownerID = $_POST['parentIDName'];

found in:

      $file->OwnerID = Member::currentUserID();
			if($hasDataObject) {
				$file->write();
				$obj = new $do_class();		
				$obj->$idxfield = $file->ID;
				$ownerID = $_POST['parentIDName'];
				$obj->$ownerID = $_POST['controllerID'];
				$obj->write();
				echo $obj->ID;
			}

Avatar
Graphicator

Community Member, 62 Posts

7 July 2010 at 10:52am

Edited: 07/07/2010 10:54am

Disregard the previous post, I fixed it shortly after...

From looking at what parentIDname is populated from... the source class.
I changed my Class name from 'TaxForms.php'->class TaxForms to 'Tdocuments.php'->class Tdocuments

Having two uppercaps in the source name seemed to be the problem for me. Is there a mention of that in the docs that I overlooked? I also was hesitant to create a class named Form, or Document. Aren't there names I should avoid?

Avatar
martinluff

Community Member, 4 Posts

16 July 2010 at 12:15am

Yes, I'm getting the same problem (have also tried applying the patches to Sapphire but makes no difference to this issue).

Once file upload is initiated then the progress bar gets stuck on 'Processing...' I tested on live Unix server (LAMP stack) and no problems at all with same builds of SilverStripe 2.4, SWFupload and Data Object Manager. The problem is on my dev server (Windows 7 using the popular WAMP server...) Thanks in advance...

SWF debug info:

---SWFUpload Instance Info---
Version: 2.2.0 Alpha
Movie Name: SWFUpload_0
Settings:
	upload_url:               http://ss24b.dev/FileDataObjectManager_Controller/handleswfupload
	flash_url:                http://ss24b.dev/swfupload/javascript/swfupload.swf?swfuploadrnd=850275533
	use_query_string:         false
	file_post_name:           swfupload_file
	post_params:              [object Object]
	file_types:               
	file_types_description:   
	file_size_limit:          2MB
	file_upload_limit:        20
	file_queue_limit:         20
	debug:                    true
	prevent_swf_caching:      true
	button_placeholder_id:    spanButtonPlaceholder
	button_image_url:         http://ss24b.dev/swfupload/images/upload_button.png
	button_width:             180
	button_height:            24
	button_text:              <span class='button'>Upload files</span>
	button_text_style:        .button { font-family: Helvetica, Arial, sans-serif; font-size: 12px; }
	button_text_top_padding:  6
	button_text_left_padding: 6
	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: Build Number:           SWFUPLOAD 2.2.0 Alpha 2008-10-17
SWF DEBUG: movieName:              SWFUpload_0
SWF DEBUG: Upload URL:             http://ss24b.dev/FileDataObjectManager_Controller/handleswfupload
SWF DEBUG: File Types String:      *.*
SWF DEBUG: Parsed File Types:      
SWF DEBUG: File Types Description:  ()
SWF DEBUG: File Size Limit:        2097152 bytes
SWF DEBUG: File Upload Limit:      20
SWF DEBUG: File Queue Limit:       20
SWF DEBUG: Post Params:
SWF DEBUG:                         parentIDName=ParentID
SWF DEBUG:                         hasDataObject=0
SWF DEBUG:                         OverrideUploadFolder=assets/upload/
SWF DEBUG:                         controllerID=1
SWF DEBUG:                         PHPSESSID=4dmllt2m0rdo3mtsget8eb5j61
SWF DEBUG:                         dataObjectClassName=File
SWF DEBUG:                         fileFieldName=Files
SWF DEBUG:                         dataObjectFieldName=
SWF DEBUG:                         fileClassName=File
SWF DEBUG: ----- END SWF DEBUG OUTPUT ----
SWF DEBUG: 
SWF DEBUG: Event: fileDialogStart : Browsing files. Multi Select. Allowed file types: *.*
SWF DEBUG: Select Handler: Received the files selected from the dialog. Processing the file list...
SWF DEBUG: Event: fileQueued : File ID: SWFUpload_0_0
SWF DEBUG: Event: fileDialogComplete : Finished processing selected files. Files selected: 1. Files Queued: 1
SWF DEBUG: StartUpload: First file in queue
SWF DEBUG: Event: uploadStart : File ID: SWFUpload_0_0
SWF DEBUG: Global Post Item: parentIDName=ParentID
SWF DEBUG: Global Post Item: hasDataObject=0
SWF DEBUG: Global Post Item: OverrideUploadFolder=assets/upload/
SWF DEBUG: Global Post Item: controllerID=1
SWF DEBUG: Global Post Item: PHPSESSID=4dmllt2m0rdo3mtsget8eb5j61
SWF DEBUG: Global Post Item: dataObjectClassName=File
SWF DEBUG: Global Post Item: fileFieldName=Files
SWF DEBUG: Global Post Item: dataObjectFieldName=
SWF DEBUG: Global Post Item: fileClassName=File
SWF DEBUG: ReturnUploadStart(): File accepted by startUpload event and readied for upload.  Starting upload to http://ss24b.dev/FileDataObjectManager_Controller/handleswfupload for File ID: SWFUpload_0_0
SWF DEBUG: Event: uploadProgress (OPEN): File ID: SWFUpload_0_0
SWF DEBUG: Event: uploadProgress: File ID: SWFUpload_0_0. Bytes: 262561. Total: 262561

Avatar
UncleCheese

Forum Moderator, 4102 Posts

16 July 2010 at 2:22am

Due to a security hole, we had to patch the FileDataObjectManager_Controller::handleswfupload(); function to be behind authentication. In order to keep the session alive in the Flash request, a session_id parameter was added in swfupload. Therefore, with the latest version of DOM, you need to have the latest version of SWFUpload as well.

Ensure that line 20 of SWFUploadField.php reads:

SWFUploadConfig::addPostParam('PHPSESSID',session_id());

And make sure that the PHP setting "session.use_only_cookies" is set to off.

Avatar
martinluff

Community Member, 4 Posts

16 July 2010 at 10:15am

Solved - thanks for the very quick response UncleCheese :-)

Switching off the session.use_only_cookies sorted the issue... (was already using up-to-date version of SWFupload) *cool

Go to Top