Jump to:

7938 Posts in 1541 Topics by 945 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » Trouble with upload

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Page: 1 2
Go to End
Author Topic: 1593 Views
  • poblom
    Avatar
    Community Member
    25 Posts

    Trouble with upload Link to this post

    Checked out rev 403 of DOM from svn the other day and now i find that i am unable to upload. Tried everything i can think of to no avail. Different browsers, other computers - but same problem. I have another site (SS 2.3.7) on the same server where uploading works as expected so can´t really blame server settings. What happens is that i can choose file(s) but when clicking "Upload" everything stops at "uploading..." and sits there forever. Reverting back to an older version of DOM from backup fix the problem but that´s not the sort of solution i want. Output from debug below:

    ---SWFUpload Instance Info---
    Version: 2.2.0 Alpha
    Movie Name: SWFUpload_0
    Settings:
       upload_url: http://87.241.95.75:82/FileDataObjectManager_Controller/handleswfupload
       flash_url: http://87.241.95.75:82/swfupload/javascript/swfupload.swf?swfuploadrnd=125775913
       use_query_string: false
       file_post_name: swfupload_file
       post_params: [object Object]
       file_types:
       file_types_description:
       file_size_limit: 8MB
       file_upload_limit: 20
       file_queue_limit: 20
       debug: true
       prevent_swf_caching: true
       button_placeholder_id: spanButtonPlaceholder
       button_image_url: http://87.241.95.75:82/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://87.241.95.75:82/FileDataObjectManager_Controller/handleswfupload
    SWF DEBUG: File Types String: *.*
    SWF DEBUG: Parsed File Types:
    SWF DEBUG: File Types Description: ()
    SWF DEBUG: File Size Limit: 8388608 bytes
    SWF DEBUG: File Upload Limit: 20
    SWF DEBUG: File Queue Limit: 20
    SWF DEBUG: Post Params:
    SWF DEBUG: controllerID=1
    SWF DEBUG: PHPSESSID=rrm9bl1d441f1nn94gonvc2t71
    SWF DEBUG: hasDataObject=0
    SWF DEBUG: parentIDName=ParentID
    SWF DEBUG: dataObjectFieldName=
    SWF DEBUG: fileClassName=File
    SWF DEBUG: dataObjectClassName=File
    SWF DEBUG: fileFieldName=Files
    SWF DEBUG: OverrideUploadFolder=assets/Uploads/
    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: controllerID=1
    SWF DEBUG: Global Post Item: PHPSESSID=rrm9bl1d441f1nn94gonvc2t71
    SWF DEBUG: Global Post Item: hasDataObject=0
    SWF DEBUG: Global Post Item: parentIDName=ParentID
    SWF DEBUG: Global Post Item: dataObjectFieldName=
    SWF DEBUG: Global Post Item: fileClassName=File
    SWF DEBUG: Global Post Item: dataObjectClassName=File
    SWF DEBUG: Global Post Item: fileFieldName=Files
    SWF DEBUG: Global Post Item: OverrideUploadFolder=assets/Uploads/
    SWF DEBUG: ReturnUploadStart(): File accepted by startUpload event and readied for upload. Starting upload to http://87.241.95.75:82/FileDataObjectManager_Controller/handleswfupload for File ID: SWFUpload_0_0
    SWF DEBUG: Event: uploadProgress (OPEN): File ID: SWFUpload_0_0

  • poblom
    Avatar
    Community Member
    25 Posts

    Re: Trouble with upload Link to this post

    I continue this story myself!

    Did some further troubleshooting and found that the offending line was the permission check on the first line of handleswfupload in FileDataObjectManager_Controller.

    This check [Permission::check("CMSAccess_CMSMain")] returns false so upload stops here. Commenting out the line and upload completes.

    This function uses Member::currentUserID() but as far as I can see this value is not available here for some reason, var_dump() returns 0.

    On the other hand if I hard-code my userid and change the test like so:

    if(!Permission::checkMember(2,"CMSAccess_CMSMain")) return;

    upload works again, not to surprisingly.

    So, the conclusion must be that my userid, and ultimately the Session, is not available. The question is why!!

    Any clever person who can shed some light?? Uncle are you there?

    P.S This is SS 2.4.0 and DOM rev. 405

  • UncleCheese
    Avatar
    4085 Posts

    Re: Trouble with upload Link to this post

    Sorry, I can't replicate this with SS 2.4 r405. If you turn on SWFUploadConfig::debug(), do you see PHPSESSID in your post params? If it's passing a PHPSESSID, your session should persist.

  • UncleCheese
    Avatar
    4085 Posts

    Re: Trouble with upload Link to this post

    Can you get your PHP ini setting for "session.use_only_cookies"?

  • poblom
    Avatar
    Community Member
    25 Posts

    Re: Trouble with upload Link to this post

    Thank's for a quick reply!

    It most certainly is there.

    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://87.241.95.75:82/FileDataObjectManager_Controller/handleswfupload
    SWF DEBUG: File Types String: *.*
    SWF DEBUG: Parsed File Types:
    SWF DEBUG: File Types Description: ()
    SWF DEBUG: File Size Limit: 8388608 bytes
    SWF DEBUG: File Upload Limit: 20
    SWF DEBUG: File Queue Limit: 20
    SWF DEBUG: Post Params:
    SWF DEBUG: hasDataObject=0
    SWF DEBUG: dataObjectClassName=File
    SWF DEBUG: fileClassName=File
    SWF DEBUG: OverrideUploadFolder=assets/Wildanimals/
    SWF DEBUG: PHPSESSID=n5677cko7foicroflmrp7s6362
    SWF DEBUG: fileFieldName=Files
    SWF DEBUG: controllerID=5
    SWF DEBUG: dataObjectFieldName=
    SWF DEBUG: parentIDName=ParentID
    SWF DEBUG: ----- END SWF DEBUG OUTPUT ----
    SWF DEBUG:

    I also var_dump'ed it from inside handleswfupload to be sure. Can I use this ID in some way?

  • poblom
    Avatar
    Community Member
    25 Posts

    Re: Trouble with upload Link to this post

    session.use_only_cookies is set to On

  • UncleCheese
    Avatar
    4085 Posts

    Re: Trouble with upload Link to this post

    There ya go. PHP won't accept sessions passed through the request. That needs to be off.

  • poblom
    Avatar
    Community Member
    25 Posts

    Re: Trouble with upload Link to this post

    You are a true genius and such an asset to this community. Thanks!

    While I have your attention - There is a small "bug" in SimpleTinyMCEField.php. I had two such fields in a popup, everything was beautiful and worked fine until I later on added two DateTimeField's. Then the buttons disappeared. The fix was simple though. I put the built javascript in the buildJS() function in a closure and all was well again.

    Thanks again!

    1593 Views
Page: 1 2
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.