7912 Posts in 1355 Topics by 930 members
DataObjectManager Module
SilverStripe Forums » DataObjectManager Module » SOLVED get 406 server errors when trying to upload images
Discuss the DataObjectManager module, and the related ImageGallery module.
Moderators: martimiz, UncleCheese, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
| Go to End | Next > | |
| Author | Topic: | 3217 Views |
-
SOLVED get 406 server errors when trying to upload images

16 May 2009 at 2:34am Last edited: 17 May 2009 8:08pm
hi,
i try to upload images to the image_gallery.
i have ss2.3.1, flash player 10+, swfupload 2.2 and the asset folder is 777 - but i always get an server error telling me, the server could not accept it.here the swfupload debug output:
---SWFUpload Instance Info---
Version: 2.2.0 2009-03-25
Movie Name: SWFUpload_0
Settings:
upload_url: http://xxx/ImageGalleryManager_Controller/handleswfupload
flash_url: http://xxx/swfupload/javascript/swfupload.swf?preventswfcaching=1242397740447
use_query_string: false
requeue_on_error: false
http_success:
assume_success_timeout: 0
file_post_name: swfupload_file
post_params: [object Object]
file_types: *.jpg;
file_types_description:
file_size_limit: 64MB
file_upload_limit: 20
file_queue_limit: 20
debug: true
prevent_swf_caching: true
button_placeholder_id: spanButtonPlaceholder
button_placeholder: Not Set
button_image_url: http://xxx/swfupload/images/upload_button.png
button_width: 180
button_height: 24
button_text: <span class='button'>Upload Images...</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: trueSWF DEBUG: SWFUpload Init Complete
SWF DEBUG:
SWF DEBUG: ----- SWF DEBUG OUTPUT ----
SWF DEBUG: Build Number: SWFUPLOAD 2.2.0
SWF DEBUG: movieName: SWFUpload_0
SWF DEBUG: Upload URL: http://xxx/ImageGalleryManager_Controller/handleswfupload
SWF DEBUG: File Types String: *.jpg;
SWF DEBUG: Parsed File Types: jpg,
SWF DEBUG: HTTP Success: 0
SWF DEBUG: File Types Description: (*.jpg;)
SWF DEBUG: File Size Limit: 67108864 bytes
SWF DEBUG: File Upload Limit: 20
SWF DEBUG: File Queue Limit: 20
SWF DEBUG: Post Params:
SWF DEBUG: dataObjectFieldName=GalleryItems
SWF DEBUG: controllerID=6
SWF DEBUG: fileClassName=ImageGalleryImage
SWF DEBUG: dataObjectClassName=ImageGalleryItem
SWF DEBUG: AlbumID=1
SWF DEBUG: fileFieldName=Image
SWF DEBUG: parentIDName=ImageGalleryPageID
SWF DEBUG: OverrideUploadFolder=Uploads
SWF DEBUG: ----- END SWF DEBUG OUTPUT ----
SWF DEBUG:
SWF DEBUG: Event: fileDialogStart : Browsing files. Multi Select. Allowed file types: *.jpg;
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=GalleryItems
SWF DEBUG: Global Post Item: controllerID=6
SWF DEBUG: Global Post Item: fileClassName=ImageGalleryImage
SWF DEBUG: Global Post Item: dataObjectClassName=ImageGalleryItem
SWF DEBUG: Global Post Item: AlbumID=1
SWF DEBUG: Global Post Item: fileFieldName=Image
SWF DEBUG: Global Post Item: parentIDName=ImageGalleryPageID
SWF DEBUG: Global Post Item: OverrideUploadFolder=Uploads
SWF DEBUG: ReturnUploadStart(): File accepted by startUpload event and readied for upload. Starting upload to http://xxx/ImageGalleryManager_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: 542704. Total: 542704
SWF DEBUG: Event: uploadError: HTTP ERROR : File ID: SWFUpload_0_0. HTTP Status: 406.
SWF DEBUG: Event: uploadComplete : Upload cycle complete.
Error Code: -200, File name: IMG_3914.jpg, File size: 542704, Message: 406does someone know how to solve this?
thanks
-
Re: SOLVED get 406 server errors when trying to upload images

16 May 2009 at 3:12am
Hi, marcink,
Sorry you're having problems. Are you on the latest SVN checkouts of both dataobject_manager and swfupload?
The best way to debug this is to activate SWFUploadConfig::debug() in your _config.php, and edit the function handleswfupload() in the FileDataObjectManager_Controller class. Add a die('hello'); to new lines of the function, starting at the top, and work your way down. If the function ran okay up until that point, you'll receive a "Server said 'hello'" message. If it didn't, you'll get the "There was a problem with your upload" message. Move it around until you pinpoint the exact line that is causing the error. It is almost always a PHP error that causes the problem.
Sorry it's such a pain. These errors used to happen all the time, but as more people use the module, we've been able to clean it up quite a bit. Report anything you find. Thanks.
-
Re: SOLVED get 406 server errors when trying to upload images

16 May 2009 at 3:17am
On second look, a 406 error could be a little more difficult to troubleshoot. Looks like your server isn't accepting the headers being sent. Do you have any control over that? Is this a local installation?
-
Re: SOLVED get 406 server errors when trying to upload images

16 May 2009 at 3:26am
no, it's a commercial host...
but i have a quiet good relationship with them...
i can also try to isolate swfupload, and run it on a subdomain without ss...
but i also try with the die() command.
thanks
-
Re: SOLVED get 406 server errors when trying to upload images

16 May 2009 at 4:01am
i think, the error happens before the function handleswfupload() is called.
even if i put die("hello"); on the first line, i get the error. -
Re: SOLVED get 406 server errors when trying to upload images

16 May 2009 at 4:17am
I figured as much. You should ask your hosting provider to look at the error logs and find out why the headers are being rejected, and maybe have them add in an exception to get them allowed. I have to say, this is the first time I've heard of it, so whatever restriction needs to be lifted to allow the Flash headers can't be that big a security risk.
-
Re: SOLVED get 406 server errors when trying to upload images

17 May 2009 at 8:07pm
here the solution i got after asking the provider. maybe it helps someone as well.
i had to edit my .htaccess file and put:
SecFilterEngine Off
inside.
-
Re: SOLVED get 406 server errors when trying to upload images

18 May 2009 at 3:45am
Perfect! Thank you for tracking that down. This is really good information to have.
| 3217 Views | ||
| Go to Top | Next > |

